Laravel5应用在子文件夹,认证重定向不工作 [英] Laravel5 app in subfolder, authentication redirection not working

查看:176
本文介绍了Laravel5应用在子文件夹,认证重定向不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我面对奇怪的问题。在我的开发环境,我在nginx的创建的虚拟目录(宅基地)一切工作正常。但这个应用程序需要在生产中的Apache根目录下子目录进行安装。

I am facing strange problem. On my development environment (homestead) everything is working fine as I created virtual directory in nginx. But this app needs to be installed under subdirectory of apache root directory in production.

当我与安全中间件(控制器AUTH),它重定向到正确的登录页面。当我输入凭据,它重定向到的 http://example.com/auth/login 。我不知道什么用它去错了。我尝试了所有选项,包括在.htaccess变化在其他职位建议,但没有工作。

When I secure controller with middleware ("auth), it redirects to login page correctly. When I enter credentials, it redirects to "http://example.com/auth/login". I am not sure whats going wrong with it. I tried all options including changes in .htaccess as suggested in other posts but none is working.

推荐答案

验证的观点在他们很难codeD URL和他们所造成这些问题。

Auth views have hardcoded URLs in them and they are causing these issues.

进入资源/视图/认证/ login.blade.php,改变

Go to "resources/views/auth/login.blade.php" and change

action="/auth/login"

action="{{ url('auth/login') }}"


做的每一个动作和href属性相同的整个资源/视图/ AUTH目录。


Do the same for every action and href attributes throughout the "resources/views/auth" directory.

这篇关于Laravel5应用在子文件夹,认证重定向不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆