如果有人能夠幫助我解決這個問題,我將非常感激...我一直在我的個人業務網站上使用.htaccess 301重定向文件一段時間但現在,在文件中的某個點之後,重定向根本不起作用(在Rex Swain的http頭工具中返回200)。.htaccess - 文件中的某個點無法正常工作後重定向
我已經通過文件查看了一個精細的牙齒和重定向停止工作的地方,根本沒有問題(例如,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
在你的應用程序中必須有一些重定向邏輯。從'/ spa/alexander-house/overnight-packages'重定向到'http:// www.domain/spa/alexander-house/spa-breaks'時,「spa-break」從哪裏來? –
啊這些都是'mod_alias'模塊支持的簡單靜態重定向http://httpd.apache.org/docs/current/mod/mod_alias.html#redirect –
對不起Michael,這是什麼意思呢?要回答上面的第一條評論,spa-break是/ alexander house /目錄中的一個頁面。我已經從本地目錄中刪除了頁面/通宵套餐/頁面,但它仍然在遠程服務器上 – Motley9735