更改tags.php文件在根目录 找到 $tag = FilterSearch(urldecode( $tag )); 1 替换为: $tag = urldecode( $tag ); 1 更改文件arc .taglist .class .php 文件文件所在的路径是include/arc .taglist .class .php 1 找到 $this-TagInfos = $this-dsql-GetOne("S […]
更改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 `58pic_tagindex` where taglike '{$this->Tag}' ");
替换为:
$this->TagInfos = $this->dsql->GetOne("Select * From `58pic_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='tags.php'>TAG标签</a> > {dede:field.title /}
替换为:
<strong>当前位置:</strong><a href="{dede:global.cfg_cmsurl/}/">主页</a> > <a href='/tags/'>TAG标签</a>
{dede:sql sql="select tag from 58pic_tagindex where id=~title~"}[field:tag/]{/dede:sql}
.htaccess文件里增加如下规则:
RewriteEngine On
RewriteBase /
RewriteRule ^tags/(.*)$ /tags.php?/$1
如需更改为/tags/1.html,则修改为,以上织梦php就不做说明
RewriteEngine On
RewriteBase /
RewriteRule ^tags/(.*)\.html$ /tags.php?/$1
RewriteRule ^tags/ /tags.php
最后在根目录下robots.txt中添加 Disallow: /tags.php 防止搜索引擎重复收录。