View Full Version : Exclude one folder from being re-writen - .htaccess

03-12-2010, 04:40 PM
Hello everyone,

I have the rule to re-write every non-www into a www. However, there is one folder I want to exclude as when I try to access it without the www it generates an error. I know it can be done, and I have seen the solution online, yet I don't quite know what to write to get it done. Here's how my .htacces looks like for the mod_rewrite part:

RewriteEngine On
RewriteBase /
RewriteRule ^(press_kit) - [L]
RewriteCond %{HTTP_HOST} !^www\.site\.com$ [NC]
RewriteRule ^(.*)$ http://www.site/$1 [R=301,L]

Now, in order to avoid this issue for the "press_kit" folder, what do I have to add to make it work with or without the www?

Thank you before hand,

k. :mrgreen:

03-17-2010, 05:27 PM
It seems nobody knows the answer to this! I'm still stuck, but I think I can't do much on my own.

Thanks! :o

03-18-2010, 05:59 PM
Just add a .htaccess file in the press_kit folder

03-18-2010, 06:01 PM
Just add a .htaccess file in the press_kit folder

Hey Domemia,

I did that as part of the settings I did for that client. This folder is also password-protected. :mrgreen: