您好,欢迎来到二三娱乐。
搜索
您的当前位置:首页设置HTTP重定向为HTTPS

设置HTTP重定向为HTTPS

来源:二三娱乐

方法一

使用 WordPress Really Simple SSL 插件

方法二

  1. 启动重定向:sudo a2enmod rewrite #启动rewrite mod
  2. 设置http端口重定向,在网站根目录wordpress下新建.htaccess文件,在文件中输入内容:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$  [R=301,L]
RewriteCond %{HTTP_HOST}  [NC]
RewriteRule ^(.*)$  [L,R=301]
  • 将数据库写死的http修改为https
    服务器上进入当前数据库:
update wp_options set option_value =  where option_id in(1,2);
update wp_posts set post_content = replace(post_content, 

最后重启下apache服务:
sudo service apache2 restart

对数据库错误的更新对网站可能是毁灭性的打击,建议更新前最好备份数据库。

Copyright © 2019- yule263.com 版权所有 湘ICP备2023023988号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务