章工运维 章工运维
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)

章工运维

业精于勤,荒于嬉
首页
  • linux
  • windows
  • 中间件
  • 监控
  • 网络
  • 存储
  • 安全
  • 防火墙
  • 数据库
  • 系统
  • docker
  • 运维工具
  • other
  • elk
  • K8S
  • ansible
  • Jenkins
  • GitLabCI_CD
  • 随笔
  • 面试
  • 工具
  • 收藏夹
  • Shell
  • python
  • golang
友链
  • 索引

    • 分类
    • 标签
    • 归档
    • 首页 (opens new window)
    • 关于我 (opens new window)
    • 图床 (opens new window)
    • 评论 (opens new window)
    • 导航栏 (opens new window)
周刊
GitHub (opens new window)
  • linux

  • windows

  • 中间件

  • 网络

  • 安全

  • 存储

  • 防火墙

  • 数据库

  • 系统

    • vmware

    • ftp

    • nexus

    • harbor

    • confluence&jira

    • loki

    • sonarqube

    • svn

    • other

    • openldap

    • influxdb

    • wordpress

      • wordpress迁移问题总结
    • kvm

    • argocd

    • jfrog

    • nextcloud

    • RustDesk

    • mail

    • ghost

  • docker

  • other

  • 监控

  • 运维
  • 系统
  • wordpress
章工运维
2023-06-09

wordpress迁移问题总结

  1. 设置固定连接访问

nginx配置

    location / {
      index index.html index.php;
       if (-f $request_filename/index.html) {
         rewrite (.*) $1/index.html break;
      }
       if (-f $request_filename/index.php) {
        rewrite (.*) $1/index.php;
       }
      if (!-f $request_filename) {
        rewrite (.*) /index.php;
      }
    }
1
2
3
4
5
6
7
8
9
10
11
12
  1. 访问域名修改

修改数据库表wp_options

option_name的值
siteurl 
home
1
2
3
  1. 设置https访问

wp-config.php添加如下内容

$_SERVER[‘HTTPS’] = ‘on’;
define(‘FORCE_SSL_LOGIN’, true);
define(‘FORCE_SSL_ADMIN’, true);

继续修改wp-includes/load.php或wp-includes/functions.php 这个文件,搜索is_ssl找到对应的函数,将$SERVER['HTTPS']修改为$_SERVER['HTTP_FROM_HTTPS'](修改文件前请注意备份)。

58655e14f307d8f5.png

或将此函数修改为:

function is_ssl() {
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'){
return true;
}
elseif (isset($_SERVER["HTTP_FROM_HTTPS"])&&$_SERVER["HTTP_FROM_HTTPS"]=='on'){
return true;
}
elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){
return true;
}
else{
return false;
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
微信 支付宝
上次更新: 2023/06/09, 19:14:23

← filebeat+logstash+influxdb+ Grafana打造网站日志监控系统 centos7安装kvm虚拟机→

最近更新
01
shell脚本模块集合
05-13
02
生活小技巧(认知版)
04-29
03
生活小技巧(防骗版)
04-29
更多文章>
Theme by Vdoing | Copyright © 2019-2025 | 点击查看十年之约 | 鄂ICP备2024072800号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式