wordpress下怎么设置https强制跳转:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
以上代码是WordPress自动生成的伪静态文件 .htaccess
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
将以上代码粘贴复制到 #END WordPress 之前并保存即可。
这时候我们在访问自己WordPress站点的时候就强制跳转到https小绿标锁状态了。
原创文章,作者:陌涛,如若转载,请注明出处:https://imotao.com/302.html