1
我正在使用mod_rewrite刪除鏈接中的.php。然而,當我在重寫的鏈接中添加尾部/時出現奇怪的行爲;外部資源不加載。我想知道是否有人可以幫助緩解這一點。謝謝。htaccess mod_rewrite問題。尾隨/
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.allprepaidplans.com$ [NC]
RewriteRule ^(.*)$ http://www.allprepaidplans.com/$1 [L,R=301]
RewriteCond %{THE_REQUEST} ^GET\s(.*/)index\.php [NC]
RewriteRule . %1 [NE,R=301,L]
RewriteCond %{THE_REQUEST} ^GET\s.+\.php [NC]
RewriteRule ^(.+)\.php$ /$1 [NE,R=301,L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^(.*?)/?$ $1.php [L]