
[英]htaccess rewrite rule, url doesn't work when i add a / at the end and it show error
[英].htaccess error when url doesn't end with /
.htaccess
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/index.php$
RewriteCond %{REQUEST_URI} !\.(gif|jpeg|jpg|png|css|js|wiff|woff2|ttf)$
RewriteRule ^(.*)$ /index.php?path=$1 [NC,L,QSA]
工作网址示例
http://www.website.com/u/johndoe/asdf
http://www.website.com/u/johndoe/
唯一错误
http://www.website.com/u/johndoe
在唯一错误的情况下,URL更改为:
http://www.website.com/u/johndoe/?path=u/johndoe
有谁知道为什么将?path = u添加到URL? 它实际上位于浏览器顶部的url字段中。
有没有办法解决这个问题?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.