Htaccess Redirect for only one directory

Posted by: Alex on March 29, 2014

More often than not you’ll be using a CMS for your website, this CMS will control all traffic through set files usually (such as a root index file).

This creates a nice fluid system, where only a few files have to be changed to alter the whole website.

However, there are occasions when you want to have a certain directory to be completely different in design/feel/content etc.

The CMS .htaccess by default will try and route all requests through its normal setup.

Example: You have your amazing pet dog blog on a CMS. But you want to create a special page called which is completely separate from the rest of your site/blog.
Your CMS will currently try to relay that directory (“/competition/”) to some content, usually resulting in a 404.

This is easily achieved by bypassing the CMS’ default .htaccess rules by adding the following line before your CMS rewrite rules:

RewriteRule ^competition - [L,NC]

This is essentially just saying, if the directory is competition, do nothing and let it go to that directory and show the content there (usually an index.htm/php file).