今天再次接触laravel 的一个项目,git克隆下来之后laragon搭好环境准备跑一下
进首页还是无异常的,但是进入自己定义的route就
需要排查两个地方:
1.apache 的rewrite_module 是否已经打开 LoadModule rewrite_module modules/mod_rewrite.so
2.public目录下是否有.htaccess 如没有需要新增,打开后如果为空需要填充数据
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes... RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
再次请求异常解决。