开发者

Exceptional RewriteCond for some page

开发者 https://www.devze.com 2023-03-11 22:59 出处:网络
Let say i have domain like this http://foo.com this domain as present use .htaccess to RewriteCond and the .htaccess code is like this:

Let say i have domain like this http://foo.com

this domain as present use .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,

GusDe


The 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消