Home » Tutorial/How-To

Controlling non-WordPress Subfolder Access with .htaccess

Published on February 16, 2008 4 CommentsPrint This Post Print This Post

WordPress users commonly use the built-in permalink redirection. This means that rather then having your new blog article’s URL look like “http://myblog.com/?p=78″, you make it look like this: “http://myblog.com/articles/my-article-title.” This feature means WordPress interprets the URL query of your blog and outputs the corresponding article.

This is great for readability and SEO, but what if you want to add a non-WordPress subfolder to your website with, say, a forum in it? If you make your forum address “http://myblog.com/forum/”, WordPress will try to interpret this URL. Not being able to find anything, you will get your blog’s 404 error page. Luckily, fixing this is easy.

If you are running on an Apache server, using a simple .htaccess file is all you need. If you aren’t too familiar with .htaccess, don’t worry about it. This is what you need to do:

First, create a file called htaccess.txt on your computer. In it, paste the following code:

# disable the rewrite engine
RewriteEngine off

This will tell your web server to disable the URL rewrite engine for the specified folder.

Second, upload this txt file to the subfolder on your domain that you don’t want WordPress to interpret. Finally, rename the file that you just uploaded to .htaccess, minus the quotes. Don’t forget the initial period.

And that’s all there is too it! Now you can have subfolders on your site without conflicting with the WordPress permalink structure.

Useful Articles

This article was written by John Kolbert on February 16, 2008 and filed as Tutorial/How-To. Get the latest articles by subscribing to the RSS feed. This article, including images and attachments, is property of John Kolbert and is not to be republished or translated without prior written permission.

Post Toolbox

Share It


Print It

4 Comments »

  • peterdan said: 1 February 26, 2008 at 5:01 am

    I don’t have a server now, should I use htp://tinyurl.com or http://xiy.net to redirect my site? Thanks.

  • John Kolbert (author) said: 2 February 27, 2008 at 4:32 pm

    @peterdan I’m afraid I’m not real sure what you mean. Feel free to leave more details or to use my contact form and I’d be happy to help you.

  • max said: 3 March 27, 2008 at 7:27 am

    Thanks very good..

    max’s last blog post..Youtube’a Giriş Bileti-Girmek İsteyenler İçin

  • Cristian said: 4 August 1, 2008 at 4:14 pm

    Thank you so much, you saved my life!!

    I knew it was something related to the .htaccess file, but didn’t know what it was exactly.

    Thanks!

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Please read the comment policy before commenting.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.