迁移好玩吧 www.funet8.com 记录

迁移 www.funet8.com 记录

由于旧服务器今年7月底要到期,所以需要迁移 www.7477.com 到新的服务器中

更新内容

服务器环境: centos7+宝塔

PHP环境: php8+wordpress

更换主题:开源主题 Argon:https://github.com/solstice23/argon-theme

宝塔新建站点: www.funet8.com

ssl配置,仅供参考

ssl配置,仅供参考

server {
  listen       80;
  server_name  www.funet8.com;
  return 301   https://$host$request_uri;
}

listen 443 ssl http2;
include ssl_all_funet8_com.conf;

拷贝旧主题文件

cp -a /data/wwwroot/web/www.funet8.com/wp-content/themes/funet8-2015/ /www/wwwroot/www.funet8.com/wp-content/themes/
发现主题在php8.0下有很多报错

更换主题

https://github.com/solstice23/argon-theme

下载最新的主题包,安装

wordpress关闭报错

wordpress关闭报错

编辑 wp-config.php文件

define('WP_DEBUG', false);

打开调试模式:
define( 'WP_DEBUG', true );
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', true);

修复报错

wordpress报错 : Warning: Trying to access array offset on value of type bool in functions.php on line 319 怎么解决

319行是这么写的:return apply_filters("argon_post_thumbnail", wp_get_attachment_image_src(get_post_thumbnail_id($postID), "full")[0]);


if (is_int($postID) && get_post_thumbnail_id($postID)) {
  return apply_filters("argon_post_thumbnail", wp_get_attachment_image_src(get_post_thumbnail_id($postID), "full")[0]);
} else {
  return false; // 或者根据需求返回其他默认值
}

将静态迁移文件

nginx跳转
https://www.funet8.com/img/yamaxun-gif/1.gif
https://img.funet8.com/yamaxun-gif/1.gif

修改数据库:
UPDATE wp_posts SET post_content = REPLACE( post_content, 'https://www.funet8.com/img/', 'https://img.funet8.com/' )


cp -a /data/wwwroot/web/www.funet8.com/wp-content/uploads  /www/wwwroot/img.funet8.com

https://img.funet8.com/uploads/2021/08/image.png
跳转:
https://img.funet8.com/uploads/2021/08/image.png

UPDATE wp_posts SET post_content = REPLACE( post_content, 'https://img.funet8.com/uploads/', 'https://img.funet8.com/uploads/' )


cp -a  /www/wwwroot/www.funet8.com/wp-content/uploads /www/wwwroot/img.funet8.com
rm -rf /www/wwwroot/www.funet8.com/wp-content/uploads/*

修改后台配置

撰写

阅读

媒体

固定链接

文章404了
https://www.funet8.com/4825.html

修改之后的伪静态

location /
{
     try_files $uri $uri/ /index.php?$args;
}
 
rewrite /wp-admin$ $scheme://$host$uri/ permanent;

按照以下方法修改伪静态

Argon 主题设置

相似文章推荐

页脚内容

把百度监控去掉了,如果加上会导致页面加载失败

<p>
Copyright © 2012 - www.funet8.com All rights reserved.
<a rel="nofollow" target="_blank" href="https://beian.miit.gov.cn/">粤ICP备20027822号</a>
<a rel="nofollow" target="_blank" href="https://www.aliyun.com/minisite/goods?userCode=5qfzbvhn">阿里云</a>
</p>

代码高亮

评论区

头部菜单

效果:

暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇