我已经写了下面的代码在我的htaccess index.php文件:重定向到根
RewriteRule ^(.*)/$ $1
RewriteCond %{REQUEST_URI} !^index.php.*$
RewriteRule ^(.*)$ /index.php?route=$1 [END]
它可以完美的每一条路径,除了存在目录。例如,如果我输入http://localhost/profilepic
并且这样的目录实际存在,它将重定向到到http://localhost/profilepic/?route=profilepic
,但我希望它是隐含转换为http://localhost/index.php?route=profilepic
。
在此先感谢。
谢谢Jon!这解决了这个问题;) – Javid