更改tags.php文件在根目录

找到$tag = FilterSearch(urldecode($tag));

替换为:$tag = urldecode($tag);

更改文件arc.taglist.class.php文件文件所在的路径是include/arc.taglist.class.php

找到$this->TagInfos = $this->dsql->GetOne("Select * From `dede_tagindex` where taglike ‘{$this->Tag}’ ");替换为:

$this->TagInfos = $this->dsql->GetOne("Select * From `dede_tagindex` where id like'{$this->Tag}’ ");

更改文件tag.lib.php 文件所在的路径include/taglib/tag.lib.php

找到$row[‘keyword’] = $row[‘tag’]; 将$row[‘tag’]更改为$row[‘id’]

找到$row[‘link’] = $cfg_cmsurl."/tags.php?/".$row[‘keyword’]."/";更改为:

$row[‘link’] = $cfg_cmsurl."/tags/".urlencode($row[‘id’]);

(在阿帕奇环境下)

修改taglist.htm模板

<strong>当前位置:</strong>:<a href="{dede:global.cfg_cmsurl/}/">主页</a> > <a href=’https://www.freexyz.cn/cms/tags.php’>TAG标签</a> > {dede:field.title /}

替换为:

<strong>当前位置:</strong><a href="{dede:global.cfg_cmsurl/}/">主页</a> > <a href=’https://www.freexyz.cn/tags/’>TAG标签</a> > {dede:field.title /}

.htaccess文件里增加如下规则:

RewriteEngine On

RewriteBase /

RewriteRule ^tags/(.*)$ /tags.php?/$1

最后在根目录下robots.txt中添加 Disallow: /tags.php 防止搜索引擎重复收录。

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。