Laravel重定向到一个路线,但随后的Apache提供了404错误 [英] Laravel redirects to a route but then apache gives 404 error
问题描述
我有一个网站,是工作在同一服务器上的不同的URL(分期),但现在我已经部署了该网站与基础URL(/)将被重定向到登录网址(所以laravel几分工作),但后来我从Apache的404错误。
I have a site that is working on the same server in a different url (staging), but now I've deployed the site and the base url ("/") is redirected to the login url (so laravel is sort of working), but then I get a 404 error from apache.
如果我用sub.domain.com/index.php/route,它的工作原理,但如果我用sub.domain.com/route重定向到登录路径,并给出了404错误。
If I use sub.domain.com/index.php/route, it works, but if I use sub.domain.com/route redirects to the login route and gives a 404 error.
我也改变了routes.php文件返回路径中的登录查看/,它显示正确的登录表单。
I also changed the routes.php to return the login view in the route "/" and it show the login form correctly.
推荐答案
添加后
AllowOverride All
到虚拟主机的配置,得到它的工作。也许是默认的配置是不允许重定向?
to the vhost configuration, got it working. Probably the default configuration wasn't allowing the redirects?
下面是我的最后一个(和工作)虚拟主机配置:
Here's my final (and working) vhost configuration:
DocumentRoot /var/www/sitefolder/public
ServerName site.domain.com
<Directory /var/www/sitefolder/public>
AllowOverride All
allow from all
Options +Indexes
</Directory>
这篇关于Laravel重定向到一个路线,但随后的Apache提供了404错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!