0

如果有人能帮我解决这个问题,我将不胜感激......我已经在我的个人商业网站上使用 .htaccess 301 重定向文件有一段时间了,但是在文件中的某个点之后,重定向根本不起作用(在 Rex Swain 的 http 标头工具中返回 200)。

我用细齿梳浏览了文件,重定向停止工作的地方根本没有问题(例如,urs 完全符合它们应该的样子)。真的不知道为什么他们会在某个点之后停止重定向?

有没有人有任何想法/建议?对于愿意提供帮助的任何人,我都可以将文件发送过去。

期待您的来信,莫特利

这是代码,最后一行是不起作用的重定向。在此之前的所有工作都很好。在最后一个之后还有其他重定向(我只是没有显示它们),它们也不会重定向。文件末尾还有一个空行。

.htaccess

RewriteEngine On
RewriteBase /
RewriteCond %{http_host} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain/$1 [L,R=301]

Options +FollowSymLinks
RewriteEngine on
# index.html to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html\ HTTP/
RewriteRule ^(.*)index\.html$ /$1 [R=301,L]

重定向示例

Redirect 301 /spas/alexander-house/overnight-packages http://www.domain/spas/alexander-house/spa-breaks

Redirect 301 /spas/alexander-house/day-packages http://www.domain/spas/alexander-house/spa-days

Redirect 301 /spas/alexander-house/weekend-packages http://www.domain/spas/alexander-house/spa-weekends

Redirect 301 /spas/armathwaite-hall/overnight-packages http://www.domain/spas/armathwaite-hall/spa-breaks

Redirect 301 /spas/armathwaite-hall/day-packages.html http://www.domain/spas/armathwaite-hall/spa-days

Redirect 301 /spas/armathwaite-hall/weekend-packages http://www.domain/spas/armathwaite-hall/spa-weekends

Redirect 301 /spas/billesley-manor/overnight-packages http://www.domain/spas/billesley-manor/spa-breaks

Redirect 301 /spas/billesley-manor/day-packages http://www.domain/spas/billesley-manor/spa-days

Redirect 301 /spas/billesley-manor/weekend-packages http://www.domain/spas/billesley-manor/spa-weekends

Redirect 301 /spas/bishopstrow-house/overnight-packages http://www.domain/spas/bishopstrow-house/spa-breaks

Redirect 301 /spas/bishopstrow-house/day-packages http://www.domain/spas/bishopstrow-house/spa-days

Redirect 301 /spas/bishopstrow-house/weekend-packages http://www.domain/spas/bishopstrow-house/spa-weekends

Redirect 301 /spas/bovey-castle/overnight-packages http://www.domain/spas/bovey-castle/spa-breaks

Redirect 301 /spas/bovey-castle/day-packages http://www.domain/spas/bovey-castle/spa-days

Redirect 301 /spas/bovey-castle/weekend-packages http://www.domain/spas/bovey-castle/spa-weekends

Redirect 301 /spas/castlemartyr/overnight-packages http://www.domain/spas/castlemartyr/spa-breaks

Redirect 301 /spas/castlemartyr/day-packages http://www.domain/spas/castlemartyr/spa-days

Redirect 301 /spas/castlemartyr/weekend-packages http://www.domain/spas/castlemartyr/spa-weekends

Redirect 301 /spas/celtic-manor/overnight-packages http://www.domain/spas/celtic-manor/spa-breaks

Redirect 301 /spas/celtic-manor/day-packages http://www.domain/spas/celtic-manor/spa-days

Redirect 301 /spas/celtic-manor/weekend-packages http://www.domain/spas/celtic-manor/spa-weekends

Redirect 301 /spas/chewton-glen/overnight-packages http://www.domain/spas/chewton-glen/spa-breaks
4

1 回答 1

0

您是否尝试将重定向移动到 .htaccess 文件中的不同行?如果重定向 301 /spas/chewton-glen/overnight-packages http://www.domain/spas/chewton-glen/spa-breaks的新行位置之后的重定向现在不起作用,那么您知道这是重定向仅是导致问题的原因。您是否尝试删除此重定向并查看前面的重定向现在是否有效?我敢打赌它与chewton-glen 目录有关吗?

于 2012-12-02T11:06:29.587 回答