Exceptional RewriteCond for some page
Let say i have domain like this http://foo.com
.htaccess
to RewriteCond
and the .htaccess
code is like this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
This Rewrite will happen to all page request,
now i want to change this to make this only happen to all page except this page:http://foo.com/en/rates.htm
because in that page i want to do 301 redirect
like this Redirect 301 /en/rates.htm http://www.google.com/index.html
How to th开发者_运维知识库is in htaccess?
Thank you in advance,
GusDeThe Redirect
directive you specified in your question should work, you can add it to your .htaccess file, before the Rewrite stuff block.
If it doesn't work still, maybe Apache has not loaded the mod_alias module, and then you can add this directive before the other Rewrite's in the .htaccess file:
RewriteRule ^/en/rates\.htm http://www.google.com/index.html [R,L]
You could have a look at this Apache docs page.
精彩评论