简体   繁体   English

Laravel 5.3重定向到https重定向了您太多次

[英]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. 我刚刚在服务器上安装了https,如果将重定向添加到非https虚拟主机,则会收到页面重定向到您的次数过多的错误。 Same error if i add it to my htaccess. 如果我将其添加到我的htaccess中,同样的错误。

Full htaccess with the redirect: 带有重定向的完整htaccess:

<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). 查看浏览器调试器的网络面板,然后将日志设置为不清除(Chrome中的 保留日志”复选框, “设置”>“通用”>“在Firefox中启用持久性” )。 Now clear your cache, visit the desired URL and watch what responses you're actually getting from the server. 现在清除您的缓存,访问所需的URL,并查看您实际上从服务器获得什么响应。 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. 它至少应为您提供有关从每个响应的“ Location标头获得的重定向的更多信息,并帮助您找到源。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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