【发布时间】:2015-01-28 11:41:01
【问题描述】:
我已经使用正 SSL 证书配置了一个域。我的专用服务器在带有 Apache 和 zPanel 的 CentOS 6 上运行。
我想将所有 http 页面重定向到 https。
我在 .htaccess 上尝试了很多不同的代码,但没有一个有效:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R=301,L]
它似乎忽略了我的 .htaccess
【问题讨论】:
标签: redirect ssl https http-status-code-301