简体   繁体   中英

Laravel 5.3 redirect to https redirected you too many times

I just installed https on my server, and if i add a redirect to my non https virtual host i get the error that the page redirected you too many times. Same error if i add it to my htaccess.

Full htaccess with the redirect:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On
RewriteCond %{HTTPS} =off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Any ideas?

Thanks!

Look at the network panel of your browser's debugger, and set the logs not to clear ( Preserve log checkbox in Chrome, Settings > Common > Enable persistent in Firefox). Now clear your cache, visit the desired URL and watch what responses you're actually getting from the server. It should at least give you more information on what redirects you're getting from each response's Location header and help you find the source.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM