阿里云cdn和虚拟机实现https安装wodrpress

配置cnd时候先选择默认,使用普通的http安装。

正常安装完成后

先进入控制台-外观-编辑,找到functions.php编辑加入以下代码:

add_filter('script_loader_src', 'agnostic_script_loader_src', 20,2);
function agnostic_script_loader_src($src, $handle) { return preg_replace('/^(http|https):/', ", $src); }
add_filter('style_loader_src', 'agnostic_style_loader_src', 20,2); 
function agnostic_style_loader_src($src, $handle) { return preg_replace('/^(http|https):/', ", $src); }

安装插件。Really Simple SSL插件。

插件地址:https://wordpress.org/plugins/really-simple-ssl/ 下载完成后上传插件安装。安装完成后点击启用即可。

在安装完成插件后把cdn访问改成http->https。

这样简单的https就配置完成了基本就可以访问了。

更多详细配置参考

https://www.againfly.com/flytag_396.html

https://www.zhujib.com/wordpressbokeqiyonghttpschajian-yijianqiyongqi.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值