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]