我的 .htaccess 文件中有一个 mod 重写,其中包含几个重写条目:
RewriteRule ^/services/(\w+)$ controllers/$1.php [L]
RewriteRule ^.*$ index.html [L]
每当我访问http://blah.com/services/something时,它都会将我重定向到 blah.com 的索引,而不是匹配第一条规则然后停止。
另外:如果我将最后一条规则更改为:
RewriteRule ^(\w+)$ index.html [L]
应用程序“有效”,只是在第一个 / 之后有其他路径时无效。
为什么会这样?