为了能够将所有的http重定向到https,我使用了以下.htaccess:
Options All -Indexes DirectoryIndex index.php index.html index.htm
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]关于我读过的文档,它应该是有效的。
但问题是我收到了错误310: ERR_TOO_MANY_REDIRECTS。
会有什么问题呢?
发布于 2015-02-10 17:11:45
我不希望它基于服务器端口,而只是检查它是否不是HTTPS,而且使用特定的服务器名称可以帮助它在部署时更容易一些!
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]https://stackoverflow.com/questions/28427652
复制相似问题