2019年 大佬有话说 :
求强制wordpress整站https的.htaccess
刚从网上找了一个,只能首页是https
RewriteEngine on
RewriteBase /
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI}
Benladen 大佬有话说 :
插件或者宝塔强制ssl
Code-k 大佬有话说 :
也可以修改Apache配置文件
cici9911 大佬有话说 :
wp对https不太友好.建议加个nginx反代在ng里搞
hjh142857 大佬有话说 :
本帖最后由 hjh142857 于 2020-4-5 10:37 编辑
我的小破typecho博客用的,http跳转https+去掉index.php的伪静态,大佬可以参考下,开了hsts但试了下首次打开非首页http也可以跳转https:lol
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{SERVER_NAME}/$1
</IfModule>
qqq409640976 大佬有话说 :
宝塔
JimLau 大佬有话说 :
直接wp-config.php里加$_SERVER[‘HTTPS’]=’ON’;
zhaorong65 大佬有话说 :
用这个插件吧:Really Simple SSL
费那个劲划不来
llyang 大佬有话说 :
套cdn,只允许https
如果nginx, 80端口跳转443就可以实现
ikxin 大佬有话说 :
https://www.ikxin.com/htaccess-https.html