PDA

View Full Version : Help with htaccess to exclude a folder from redirection


mesh2005
06-29-2007, 05:22 PM
I want all requests to all files except cgi-bin to be redirected from non-www to www. I wrote that rule but it redirects all to www, the exclusion is not working:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mydomain.com [NC]
RewriteCond %{HTTP_HOST} !^mydomain.com/cgi-bin [NC]
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L,NC]
Please help