我遇到了一个引导我的网站的额外尾随斜杠的问题
http://www.example.com/index至http://www.example.com//index
这是我的.htaccess内容
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
# Apply rule to all web pages eg html, php, htm
# RewriteRule !\.(swf|zip|tar|tar|pdf|doc|txt|js|ico|gif|jpg|png|css|php)$ index.php [NC,L]
RewriteRule captcha.jpg com/actions/image.php
RewriteRule !(\.) index.php [NC,L]
#deny access to the .ht* files
order allow,deny
deny from all
#deny access to any *.ini files
order allow,deny
deny from all
#deny access to any *.log files
order allow,deny
deny from all
1 回答
摆脱了
默认情况下,目录中的.htaccess文件的基本路径为/,因此通过添加另一个正斜杠,您的整个重写基数将为//