htaccess - Redirect when not
I have the following rule to redirect all traffic to a subfolder. However, now I need to stop it doing so in certain situations.
#
RewriteEngine On
RewriteCond %{HTTP_HOST} mywebsite.com
RewriteCond %{REQUEST_URI} !cms/
RewriteRule ^(.*)$ cms/$1 [L]
#
If the incoming request is http://www.mywebsite.com/goodies/ I wo开发者_如何学编程uld like to ignore the above redirect.
Can anyone help me?
Replace your second condition line
RewriteCond %{REQUEST_URI} !cms/
by
RewriteCond %{REQUEST_URI} !^/(cms|goodies)/
Add condition before RewriteRule as you do for cms/
RewriteCond %{REQUEST_URI} !goodies/
精彩评论