Laravel5 app in subfolder, authentication redirection not working

烂漫一生 提交于 2020-01-03 05:40:28

问题


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.

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.


回答1:


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

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

action="/auth/login"

with

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

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



来源:https://stackoverflow.com/questions/28681015/laravel5-app-in-subfolder-authentication-redirection-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!