我试图将任何页面调用重定向到public / index.php?_url = calls
我在var / www / .htaccess
中有这个<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?_url=/$1 [QSA,L]
</IfModule>
当我输入http://mywebsite.com/something/anotherthing工作正常时,重定向到public / index.php?_url = something / anotherthing,但是,当我尝试使用http://mywebsite.com/index/something时显示未找到错误。
有什么想法解决这个问题吗?感谢。
答案 0 :(得分:1)
原因是因为这个检查:
RewriteCond %{REQUEST_FILENAME} !-f
考虑“路径信息”,这意味着:/index/something
“存在”,因此通过-f
检查。
Additoinally,您需要关闭多视图:
Options -Multiviews