dedecms网站tag标签全部静态化的解决方法_dedecms_CMS教程_脚本之家

更改tags.php文件在根目录h2z迪尔课堂自学网-|第二课堂|--(官网)

找到$tag = FilterSearch(urldecode($tag));h2z迪尔课堂自学网-|第二课堂|--(官网)

替换为:$tag = urldecode($tag);h2z迪尔课堂自学网-|第二课堂|--(官网)

更改文件arc.taglist.class.php文件文件所在的路径是include/arc.taglist.class.phph2z迪尔课堂自学网-|第二课堂|--(官网)

找到$this->TagInfos = $this->dsql->GetOne("Select * From `dede_tagindex` where taglike '{$this->Tag}' ");替换为:h2z迪尔课堂自学网-|第二课堂|--(官网)

$this->TagInfos = $this->dsql->GetOne("Select * From `dede_tagindex` where id like'{$this->Tag}' ");h2z迪尔课堂自学网-|第二课堂|--(官网)

更改文件tag.lib.php 文件所在的路径include/taglib/tag.lib.phph2z迪尔课堂自学网-|第二课堂|--(官网)

找到$row['keyword'] = $row['tag']; 将$row['tag']更改为$row['id']h2z迪尔课堂自学网-|第二课堂|--(官网)

找到$row['link'] = $cfg_cmsurl."/tags.php?/".$row['keyword']."/";更改为:h2z迪尔课堂自学网-|第二课堂|--(官网)

$row['link'] = $cfg_cmsurl."/tags/".urlencode($row['id']); h2z迪尔课堂自学网-|第二课堂|--(官网)

(在阿帕奇环境下)h2z迪尔课堂自学网-|第二课堂|--(官网)

修改taglist.htm模板h2z迪尔课堂自学网-|第二课堂|--(官网)

<strong>当前位置:</strong>:<a href="{dede:global.cfg_cmsurl/}/">主页</a> > <a href='tags.php'>TAG标签</a> > {dede:field.title /}h2z迪尔课堂自学网-|第二课堂|--(官网)

替换为:h2z迪尔课堂自学网-|第二课堂|--(官网)

<strong>当前位置:</strong>?<a href="{dede:global.cfg_cmsurl/}/">主页</a> > <a href='/tags/'>TAG标签</a> > {dede:field.title /}h2z迪尔课堂自学网-|第二课堂|--(官网)

h2z迪尔课堂自学网-|第二课堂|--(官网)
.htaccess文件里增加如下规则:h2z迪尔课堂自学网-|第二课堂|--(官网)

h2z迪尔课堂自学网-|第二课堂|--(官网)
RewriteEngine Onh2z迪尔课堂自学网-|第二课堂|--(官网)

RewriteBase /h2z迪尔课堂自学网-|第二课堂|--(官网)

RewriteRule ^tags/(.*)$ /tags.php?/$1h2z迪尔课堂自学网-|第二课堂|--(官网)

最后在根目录下robots.txt中添加 Disallow: /tags.php 防止搜索引擎重复收录。h2z迪尔课堂自学网-|第二课堂|--(官网)

扫一扫手机访问