mod_rewrite不能在Laravel 5
使用Laravel 5.5,试图访问http://127.0.0.1:8000/test/search/357我得到一个页面无法找到错误。非其他解决方案已为我工作。我的.htaccess文件驻留在根目录下,看起来像这样:mod_rewrite不能在Laravel 5
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
Options +FollowSymLinks
RewriteEngine On
RewriteBase "/test/"
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/test/ # <=== NEW LINE!!!!
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
RewriteRule ^/test/search/(.*)$ /test/search?m_id=$1&a=1 [QSA, L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
任何帮助,将不胜感激。谢谢。
回答:
您可以使用:
RewriteRule ^test/search/(.*)$ /test/search?m_id=$1&a=1 [QSA, L]
没有左/ htaccess的重写规则
和地点之前#规则处理前端控制器
以上是 mod_rewrite不能在Laravel 5 的全部内容, 来源链接: utcz.com/qa/258889.html