【发布时间】:2014-04-27 15:41:48
【问题描述】:
我已遵循 this thread 的建议,该建议将对我的案例网站riverstreetflowerland.com 的所有请求重定向到 https 版本。
您可以点击进入网站上的其他页面并在 https 上查看该网站。但是,如果您获得指向主页以外页面的直接链接(如 http://riverstreetflowerland.com/about-us/),则 .htaccess 不会将您重定向到 https 版本,您将在访问主页之前以 http 浏览该站点。
这是我当前的 .htaccess 作为参考:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301]
</IfModule>
# END WordPress
我只需要 100% 的时间将网站重定向到并通过 https 浏览(有趣的是绿色挂锁让人们感到安全)。
【问题讨论】:
标签: .htaccess mod-rewrite redirect ssl https