-1
誰能幫我弄清楚爲什麼我收到此錯誤,下面是我的htaccess重定向循環錯誤刪除.PHP
RewriteEngine ON
RewriteRule ^(.*)\.php$ /$1 [R=301,L,END]
RewriteRule ^([^\.\/]+)$ /$1.php [QSA,L]
誰能幫我弄清楚爲什麼我收到此錯誤,下面是我的htaccess重定向循環錯誤刪除.PHP
RewriteEngine ON
RewriteRule ^(.*)\.php$ /$1 [R=301,L,END]
RewriteRule ^([^\.\/]+)$ /$1.php [QSA,L]
你的第一條規則可能不需要END
但第二個規則肯定會需要END
標誌停止無限重定向。您可以在Apache 2.4中使用以下規則:
RewriteEngine On
RewriteRule ^(.+)\.php$ /$1 [R=302,L,NE,NC]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+?)/?$ $1.php [END]
什麼是錯誤?您可能需要查看[如何提問],瞭解如何在此處提出可回答的問題的一些提示。 – scotthenninger
[Remove .php extension with .htaccess]可能的重複(http://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess) – starkeen