如果是没有htaccess规则,可以直接用以下规则
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
如果已有如下默认规则,
RewriteEngine On RewriteBase / RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # BEGIN WordPress RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]# EDN WordPress
注:规则必须加载 # BEGIN WordPress和# EDN WordPress之外
可以通过站长工具(http://tool.chinaz.com/pagestatus/)进行状态码检测
检测主页和内页同时返回正确的301状态码,可以到百度站长平台进行https验证
验证后很快快照就会更新成https
基于fastcgi分离和LAMP虚拟主机部署wordpress和DiscuzX