Products
GG网络技术分享 2025-03-18 16:16 0
站长笔记:
图片跳转头条真实地址伪静态规则,
location /upload9/pgc-image/ {
rewrite ^/upload9/pgc-image/(.*)$ https://p3.toutiaoimg.com/pgc-image/$1~noop.image redirect;
}
2020年之后的新图
location /upload9/ {
rewrite ^/upload9/tos-cn-i-(.*)/(.*)$ https://p3.toutiaoimg.com/tos-cn-i-$1/$2~noop.image redirect;
}
不要用mysql命令去批量修改已经发过的,因为不止有p3,还有p26...,还有https://p3.toutiaoimg.com/[参数]~noop.image这种结构的
如要加上.jpg的后缀,规则如下
location ~ ^/upload/pgc-image/(.+).jpg$ {
return 301 https://p3.toutiaoimg.com/pgc-image/$1~noop.image;
}
示例:
http://www.ggplus.cn/wp-content/uploads/2023/10/1697094808-a23cf3369021b29.jpg
跳转到
https://p3.toutiaoimg.com/pgc-image/cc0b3df88f5249428940543ad4532104~noop.image
大河插件自带配图,带的是 360buying的图片,使用以下跳转规则
location ~ ^/upload/14/(.+.jpg)$ {
return 301 https://img14.360buyimg.com/$1;
}
location ~ ^/upload/13/(.+.jpg)$ {
return 301 https://img13.360buyimg.com/$1;
}
location ~ ^/upload/12/(.+.jpg)$ {
return 301 https://img12.360buyimg.com/$1;
}
location ~ ^/upload/11/(.+.jpg)$ {
return 301 https://img11.360buyimg.com/$1;
}
location ~ ^/upload/10/(.+.jpg)$ {
return 301 https://img10.360buyimg.com/$1;
}
火车头替换:
2020之后
src="https://p3.toutiaoimg.com/tos-cn-i-[参数]/[参数]~noop.image">
src="/upload9/tos-cn-i-[参数1]/[参数2]">
src="https://p3.toutiaoimg.com/dfic-imagehandler/[参数]~noop.image">
src="/upload9/dfic-imagehandler/[参数1]">
老的图2020之前
src="https://p3.toutiaoimg.com/pgc-image/[参数]~noop.image">
src="/upload9/pgc-image/[参数1]">
火车头mysql
UPDATE Content SET [内容]=replace([内容],'https://p3.toutiaoimg.com/tos-cn-i-','/upload9/tos-cn-i-')
UPDATE Content SET [内容]=replace([内容],'~noop.image','')
WP数据库中替换:[参数]不变
update wpyst_posts SET post_content=REPLACE(REPLACE(post_content,'https://p3.toutiaoimg.com/tos-cn-i-', '/upload9/tos-cn-i-'), '~noop.image', '') WHERE post_content LIKE '%https://p3.toutiaoimg.com/tos-cn-i-%~noop.image%';
update wpyst_posts SET post_content=REPLACE(REPLACE(post_content,'https://p3.toutiaoimg.com/pgc-image/', '/upload9/pgc-image/'), '~noop.image', '') WHERE post_content LIKE '%https://p3.toutiaoimg.com/pgc-image/%~noop.image%';
update wpyst_posts SET post_content=REPLACE(REPLACE(post_content,'https://p3.toutiaoimg.com/dfic-imagehandler', '/upload9/dfic-imagehandler'), '~noop.image', '') WHERE post_content LIKE '%https://p3.toutiaoimg.com/dfic-imagehandler%~noop.image%';
update wpyst_posts SET post_content=REPLACE(post_content,'https://p3.toutiaoimg.com/dfic-imagehandler','/upload9/dfic-imagehandler')
zb
UPDATE zbp_post SET log_Content = REPLACE(REPLACE(log_Content, 'https://p3.toutiaoimg.com/tos-cn-i-', '/upload9/tos-cn-i-'), '~noop.image', '') WHERE log_Content LIKE '%https://p3.toutiaoimg.com/tos-cn-i-%~noop.image%';
UPDATE zbp_post SET log_Content = REPLACE(REPLACE(log_Content, 'https://p3.toutiaoimg.com/pgc-image/', '/upload9/pgc-image/'), '~noop.image', '') WHERE log_Content LIKE '%https://p3.toutiaoimg.com/pgc-image/%~noop.image%';
搜狗图跳转
location /upload01/ {
rewrite ^/upload01/(.*)$ https://i01piccdn.sogoucdn.com/$1 redirect;
}
location /upload02/ {
rewrite ^/upload02/(.*)$ https://i02piccdn.sogoucdn.com/$1 redirect;
}
location /upload03/ {
rewrite ^/upload03/(.*)$ https://i03piccdn.sogoucdn.com/$1 redirect;
}
location /upload04/ {
rewrite ^/upload04/(.*)$ https://i04piccdn.sogoucdn.com/$1 redirect;
}
火车头替换:
src="https://i02piccdn.sogoucdn.com/[参数]"
src="/upload02/[参数1]"
UPDATE Content SET [内容]=replace([内容],'https://i01piccdn.sogoucdn.com','/upload01');
UPDATE Content SET [内容]=replace([内容],'https://i02piccdn.sogoucdn.com','/upload02');
UPDATE Content SET [内容]=replace([内容],'https://i03piccdn.sogoucdn.com','/upload03');
UPDATE Content SET [内容]=replace([内容],'https://i04piccdn.sogoucdn.com','/upload04');
UPDATE Content SET [内容]=replace([内容],':和总体上说:','');
update zbp_post SET log_Content=REPLACE(log_Content,'https://i01piccdn.sogoucdn.com','/upload01');
update zbp_post SET log_Content=REPLACE(log_Content,'https://i02piccdn.sogoucdn.com','/upload02');
update zbp_post SET log_Content=REPLACE(log_Content,'https://i03piccdn.sogoucdn.com','/upload03');
update zbp_post SET log_Content=REPLACE(log_Content,'https://i04piccdn.sogoucdn.com','/upload04');
update zbp_post SET log_Content=REPLACE(log_Content,'总之,','');
update zbp_post SET log_Content=REPLACE(log_Content,'总结,','');
update zbp_post SET log_Content=REPLACE(log_Content,'综上所述,','');
update zbp_post SET log_Content=REPLACE(log_Content,'结尾,','');
update zbp_post SET log_Content=REPLACE(log_Content,'小结,','');
update zbp_post SET log_Content=REPLACE(log_Content,'结论,','');
update zbp_post SET log_Content=REPLACE(log_Content,'结语,','');
update zbp_post SET log_Content=REPLACE(log_Content,'您,','你');
update zbp_post SET log_Content=REPLACE(log_Content,'首先,','');
update zbp_post SET log_Content=REPLACE(log_Content,'其次,','');
update zbp_post SET log_Content=REPLACE(log_Content,'再次,','');
update zbp_post SET log_Content=REPLACE(log_Content,'此外,','');
update zbp_post SET log_Content=REPLACE(log_Content,'最后,','');
update zbp_post SET log_Content=REPLACE(log_Content,'长句提取:','');
update zbp_post SET log_Content=REPLACE(log_Content,'复合句提取:','');
update zbp_post SET log_Content=REPLACE(log_Content,'长句示例:','');
update zbp_post SET log_Content=REPLACE(log_Content,'复合句示例:','');
update zbp_post SET log_Content=REPLACE(log_Content,'长句:','');
update zbp_post SET log_Content=REPLACE(log_Content,'长句或复合句:','');
update zbp_post SET log_Content=REPLACE(log_Content,'(h2标签)','');
ZBlog文章批量修改分类目录
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%狗%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%拉布拉多%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%金毛%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%比特%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%犬%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%牧羊%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%寻回%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%哈士奇%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%二哈%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%波士顿梗%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%贵宾%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%柯基%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%西施%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%斗牛%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%博美%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%藏獒%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%阿拉%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%吉娃娃%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%牛头梗%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%金毛%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%泰迪%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%茶杯%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%可卡%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%大麦%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%雪纳瑞%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%西高地%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%萨摩耶%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%杜宾%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%贝吉格里芬梗%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%罗威纳%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%约克夏%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '2') WHERE log_Content LIKE '%边牧%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%猫%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%暹罗%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%短毛%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%缅因%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%挪威森林%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%俄罗斯蓝%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%布偶%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%孟加拉豹%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%埃及%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%阿比西尼亚%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%斯芬克斯%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%土耳其安哥拉%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%短尾%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%奥西%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%短脚%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%卷毛%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%科尼希%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%喜马拉雅%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '3') WHERE log_Content LIKE '%狸花%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '5') WHERE log_Content LIKE '%鸟%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '4') WHERE log_Title LIKE '%鸟%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '5') WHERE log_Content LIKE '%养鱼%'AND log_CateID = '1';
UPDATE zbp_post SET log_CateID = REPLACE(log_CateID, '1', '5') WHERE log_Title LIKE '%鱼%'AND log_CateID = '1';
Demand feedback