使用 .htaccess 删除尾部斜杠
我正在尝试使用此模式从网址中删除斜杠
http://localhost/~francesco/mycms/ about/
使其
http://localhost/~francesco/mycms/about
我尝试了很多规则但没有一个正在为我工作。
我的重写规则现在是这样
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~francesco/mycms/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ index.php?page=$1 [L]
</IfModule>
希望有人可以帮助我!
I am trying yo remove the trail slash from an url with this pattern
http://localhost/~francesco/mycms/about/
to make it
http://localhost/~francesco/mycms/about
I have tried lots of rules but no one is working for me.
My rewrite rule is this by now
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~francesco/mycms/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ index.php?page=$1 [L]
</IfModule>
Hope someone can help me!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

规则放在
尝试将此
如果您想在 RewriteBase 之后的任何一级目录中工作,即
http://localhost/~francesco/mycms/[anything-here]/
使用Try placing this rule
just after
If you want to work for any first level directory following the RewriteBase i.e.
http://localhost/~francesco/mycms/[anything-here]/
use