WORDPRESS改为https部署
2024-10-21 19:04:06
1.确保你已经正确开启了httpd 2.4.6的https配置,并且配置了该网站的虚拟主机,如下所示:
<VirtualHost *:443>
DocumentRoot "/appvol/wordpress_blog"
ServerName robin.org.cn
ServerAlias www.robin.org.cn
AddType text/html .php
<Directory "/appvol/wordpress_blog">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/appvol/wordpress_blog"
ServerName robin.org.cn
ServerAlias www.robin.org.cn
AddType text/html .php
#对于80端口开启RUL重定向
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]
<Directory "/appvol/wordpress_blog">
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
2.配置wordpress站点配置文件
在* @package WordPress后面添加如下配置:
//added at 2019.1.23
$_SERVER['HTTPS'] = 'on';
define('FORCE_SSL_LOGIN', true);
define('FORCE_SSL_ADMIN', true);
在
/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');
前面添加如下配置,如果已经存在,确保http已经修改为https:
//added at 2019.1.19
$yovisunhome = 'https://'.$_SERVER['HTTP_HOST'];
$yovisunsiteurl = 'https://'.$_SERVER['HTTP_HOST'];
define('WP_HOME', $yovisunhome);
define('WP_SITEURL', $yovisunsiteurl);
3.重启httpd
service httpd restart
最新文章
- ReactiveCocoa 冷热订阅(cold subscribe, hot subscribe)
- CSS3系列一(概述、选择器、使用选择器插入内容)
- 解决mvc部署在IIS上以后出现404错误
- Android之使用Volley框架在ListView中加载大量图片
- onRetainNonConfigurationInstance和getLastNonConfigurationInstance
- Entity Framework 之 Code First
- jquery跨域请求数据
- iOSiOS开发之数据存储之NSKeyedArchiver
- 怎么用VBS脚本自动注册yy娱乐的账号
- Java第6次实验提纲(异常)
- 妙谈js回调函数的理解!
- Django的rest_framework的权限组件和频率组件源码分析
- qvalue: Check that you have valid p-values or use a different range of lambda
- Shell编程积累 zhuan
- 使用ViewPager和Fragment实现滑动导航
- mysql优化【转】
- hibernate3.3.2搭建log4j日志环境
- 从邮件原理来看 postfix和docecot
- Android中WebView的跨域漏洞分析和应用被克隆问题情景还原(免Root获取应用沙盒数据)
- Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(4)
热门文章
- 剑指Offer - 九度1521 - 二叉树的镜像
- 《Cracking the Coding Interview》——第7章:数学和概率论——题目7
- Centos在VMware虚拟机上的网络配置一记
- webdriver--定位一组元素+iframe表单切换
- Pytest+allure生成测试报告
- ubuntu 16.04 安装grpc
- Android事件分发机制详解(1)----探究View的事件分发
- HDU 1171 Big Event in HDU 母函数
- Java分布式数据导出实践
- java.net.SocketException: recvfrom failed: EBADF (Bad file descriptor)