0
我從.php
我的網址擴展轉換爲.html
在我.htaccess
:URL重寫.PHP爲.html
RewriteEngine On
RewriteBase/
RewriteCond %{THE_REQUEST} (.).php
RewriteRule ^(.*).php $1.html [R=301,L]
RewriteRule ^(.*).html $1.php [L]
FallbackResource /index.php
的問題是,我有一個詞「PHP」某些部分就可以了:
www.mywebsite.com/phpscripts.php
而當它被轉換:
www.mywebsite.com/htmlscripts.html
無效(重定向LOOP)RewriteEngine敘述在 RewriteBase/ 重寫規則(+)\。PHP $ $ 1.HTML [R = 301,L] 重寫規則(+)\。HTML $ $ 1.PHP [ L] FallbackResource /index.php –
我使用redirectdetctive分析它:它多次重定向到www.mywebsite.com/phpscripts.html,所以第一個問題已解決,但如何處理循環 –
啓動Apache調試級別並分析Apache日誌中的重寫過程,如果這是您有權訪問的內容。 – deceze