.HTACCESS不重定向所有页面

时间:2014-03-27 18:14:35

标签: html asp.net apache .htaccess redirect

我有一个.htaccess文件,我需要301重定向一些页面。奇怪的是,一些页面正确地重定向,但其中一些只是显示404错误。我已经检查了很多次代码,但无法弄明白。我认为这是因为旧页面都是.asp文件 - 但是,为什么有些文件有效,有些文件没有?

这是我的.htaccess文件

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{http_host} ^bestrefrigeratorrepairman.com [NC]
RewriteRule ^(.*)$ http://www.bestrefrigeratorrepairman.com/$1 [R=301,L]
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html\ HTTP/
RewriteRule ^(.*)index\.html$ http://www.bestrefrigeratorrepairman.com/$1 [R=301,L]
#

Redirect 301 /SpanishCommAC.asp http://www.bestrefrigeratorrepairman.com/commac.html
Redirect 301 /MobileRefrigerationRes.asp‎ http://www.bestrefrigeratorrepairman.com/fridgerepair.html
Redirect 301 /MobileRefrigerationComm.asp http://www.bestrefrigeratorrepairman.com/commfridge.html
Redirect 301 /SubZero.asp‎‎ http://www.bestrefrigeratorrepairman.com/subzero.html
Redirect 301 /SpanishMobile.asp‎ http://www.bestrefrigeratorrepairman.com/index.html
Redirect 301 /MobileAirconditiongRes.asp http://www.bestrefrigeratorrepairman.com/acrepair.html
Redirect 301 /SpanishHomeRefrigerationRes.asp‎‎ http://www.bestrefrigeratorrepairman.com/homefridge.html
Redirect 301 /SpanishPayOnline.asp‎ http://www.bestrefrigeratorrepairman.com/index.html
Redirect 301 /SpanishHomeAC.asp http://www.bestrefrigeratorrepairman.com/homeac.html
Redirect 301 /HomeAC.asp‎ http://www.bestrefrigeratorrepairman.com/homeac.html
Redirect 301 /CommAC.asp http://www.bestrefrigeratorrepairman.com/commac.html
Redirect 301 /SpanishCommRefrigeration.asp http://www.bestrefrigeratorrepairman.com/commfridge.html

因此,仅举一个例子,从SpanishCommAC.asp到commac.html的第一个301重定向完美地工作。第二个不起作用。第三个确实有效。第四和第五不......等等。

这对我来说毫无意义。任何人都可以解释为什么我的.htaccess随机选择哪些重定向会起作用并忽略同一文件类型的其他重定向?

(顺便说一句,这些旧页面都不在我的服务器上了)

0 个答案:

没有答案