.htaccess 如何在htaccess中免除旧主页的目录范围重定向?

.htaccess 如何在htaccess中免除旧主页的目录范围重定向?,.htaccess,.htaccess,我试图在htaccess中免除我的旧主页在目录范围内的重定向。这是我的东西,它不起作用。我做错了什么 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] 请尝试a/以获取请求

我试图在htaccess中免除我的旧主页在目录范围内的重定向。这是我的东西,它不起作用。我做错了什么

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]

请尝试a/以获取请求uri,即

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]

它在访问www.old.com/index.html时不起作用,还是因为它是用于索引的,即如果他们要访问www.old.com,您需要它?