2
我的.htaccess文件正在創建一個重定向循環。我在網上搜索並嘗試了很多品種,包括很多來自這個網站,但仍然無法實現它的工作。它的目的是從URL的末尾刪除.html。.htaccess刪除.html導致重定向循環
這裏是我的代碼:
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME}/ -d
RewriteCond %{SCRIPT_FILENAME}.html !-f
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^(.+)\.html$ /$1 [R=301,L]
RewriteCond %{SCRIPT_FILENAME}.html -f
RewriteRule [^/]$ %{REQUEST_URI}.html [QSA,L]
它現在給我一個內部服務器錯誤。 – Jolly
檢查你的error.log並告訴我什麼是錯誤。 – anubhava
如何檢查? – Jolly