开发者

How to I exempt my old home page from a directory-wide redirect in htaccess?

开发者 https://www.devze.com 2023-01-28 13:26 出处:网络
I\'m trying to exempt my old home page from a directory-wide redirect in htaccess. Here\'s what I have that isn\'t working. What am I doing wrong?

I'm trying to exempt my old home page from a directory-wide redirect in htaccess. Here's what I have that isn't working. What am I doing wrong?

Options +FollowSymlinks
Rewri开发者_运维百科teEngine on

RewriteCond %{http_host} ^old.com?$ [nc]
RewriteCond %{REQUEST_URI} !^index\.html$
RewriteRule ^(.*)$ http://www.new.com/archive?id=$1 [r=301,nc]


try a / for the request_uri, ie.

Options +FollowSymlinks
RewriteEngine on

RewriteCond %{http_host} ^old.com?$ [nc]
RewriteCond %{REQUEST_URI} !^/index\.html$
RewriteRule ^(.*)$ http://www.new.com/archive?id=$1 [r=301,nc]
0

精彩评论

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