Xiuno 伪静态和数据库替换代码备份

伪静态配置

1. Nginx 配置

打开 nginx 配置文件 /usr/local/nginx/conf/nginx.conf,在 server 块中添加以下配置:

location ~* \.(htm)$ {
    rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last;
}

2. Xiuno BBS 配置

编辑 conf/conf.php 文件,找到以下配置项并修改:

// 将
'url_rewrite_on' => 0,

// 改为

'url_rewrite_on' => 1,

3. 重启服务

修改配置后需要重启 Nginx 服务使配置生效:

systemctl restart nginx

数据库字段替换

1. 内容数据替换

替换帖子内容中的特定字符串:

UPDATE bbs_post SET message = REPLACE(message, 'ossd', 'os');
UPDATE bbs_post SET message_fmt = REPLACE(message_fmt, 'ossd', 'os');

2. 打开全部侧边开关

启用所有帖子的侧边栏显示:

UPDATE bbs_thread SET side = 1;

3. 封面网址替换

替换帖子封面图片的URL地址:

UPDATE bbs_thread SET cover = REPLACE(`cover`, 'ossd', 'os');

4. 封面网址清除

清空所有帖子的封面图片:

UPDATE bbs_thread SET cover = '';

5. 标题替换

替换帖子标题中的特定字符串:

UPDATE bbs_thread SET subject = REPLACE(`subject`, '01', '02');