请问织梦dedecms开启伪静态后访问动态链接时301重定向跳转到对应的伪静态页面上
问题描述
织梦dedecms程序之前用的是动态链接访问。
后来使用了伪静态页面。
但是搜索引擎已经收录了很多的动态链接页面。
怎么才能将已经收录的页面301重定向到对应的伪静态页面上?
解决方法
1,打开 /plus/list.php 找到
if($cfg_rewrite == 'Y') { ...中间代码省略 }
在它里面加入
if(stripos(GetCurUrl(), '.php')) { $typeurl = GetOneTypeUrlA($dsql->GetOne("SELECT * FROM `dede_arctype` WHERE id=$tid")); header("Location: ".$typeurl, TRUE, 301); exit(); }
2,打开 /plus/view.php 找到
if($cfg_rewrite == 'Y') { ...中间代码省略 }
在它里面加入
if(stripos(GetCurUrl(), '.php')) { $url = GetOneArchive($aid); header("Location: ".$url['arcurl'], TRUE, 301); exit(); }
更新时间:2025-04-10 22:49:30
上一篇:请问易优cms如何搬家?
下一篇:请问PbootCMS网站系统修改登录界面及后台相关版权标识
转载请注明原文链接:https://www.muzicopy.com/suibi/796.html