我试图查看多个mod_rewrite问题,所以我很抱歉如果这是重复的。301重定向中的尾部斜线
我试图设置它,所以如果你去domain.com/about.php它会删除.php文件,如果你去了domain.com/about,它就是这样。
Options +FollowSymlinks
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ /$1.php [L,QSA]
RewriteRule ^(.*)/$ /$1 [L,R=301]
所以,现在如果你去domain.com/about它显示的页面,但如果你去domain.com/about.php它不会删除的扩展。
此外,我有301重定向
redirect 301 /our-clients http://www.domain.com/about-ourclients
这一工程完美,但如果用户进入与尾部斜杠domain.com/our-clients/,它们被定向到约-ourclients.php
有关如何重写规则的任何建议?
完美无瑕。非常感谢! – brianrhea