WordPress 全站更换 https

申请SSL证书

在https://www.sslforfree.com/中申请ssl证书。

修改文件

1 在wp-config.php中添加

define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);

2 在.htaccess 添加

RewriteEngine On
RewriteCond %{SERVER_PORT} =80
RewriteRule ^(.*)$ https://www.aptx4869.org/$1 [R=301,L]

RewriteCond %{SERVER_PORT} =443
RewriteCond %{HTTP_HOST} ^aptx4869.tech [NC]
RewriteRule ^(.*)$ https://www.aptx4869.org/$1 [R=301,L]

3 在设置中修改

WordPress地址(URL)https://www.aptx4869.org
站点地址(URL)https://www.aptx4869.org

4 在数据库中查询

update wp_posts set post_content = replace(post_content, 'http://www.aptx4869.tech','https://www.aptx4869.org');
update wp_posts set post_content = replace(post_content, 'http://aptx4869.tech','https://www.aptx4869.org');

 

 

 

 

 

阿七'BLOG All right reserved丨Reprint please specify
Links: https://www.aptx4869.org/https.html
Like

Leave a Reply

Your email address will not be published. Required fields are marked *