Jump to content

Help with htaccess to exclude a folder from redirection


mesh2005

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.