问题
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