【发布时间】:2016-10-31 11:09:01
【问题描述】:
我刚刚在我的服务器上安装了 https,如果我将重定向添加到我的非 https 虚拟主机,我会收到页面重定向您太多次的错误。 如果我将它添加到我的 htaccess 中,同样的错误。
带有重定向的完整 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}]
有什么想法吗?
谢谢!
【问题讨论】:
-
某事可能处于无限循环中。
标签: php .htaccess laravel mod-rewrite