无论你网站全站是静态或者动态还是伪静态,此教程都可以设置TAG标签页为伪静态,并且是单链接拼音的形式 按此教程操作后,电脑站TAG标签url会像如下:
TAG标签首页 http://www.m1850.com/tags.html
TAG标签列表 http://www.m1850.com/tags/zhimeng.html
TAG标签分页 http://www.m1850.com/tags/zhimeng_2.html
按此教程操作后,手机站TAG标签url会像如下:
TAG标签首页 http://m.m1850.com/tags.html
TAG标签列表 http://m.m1850.com/tags/zhimeng.html
TAG标签分页 http://m.m1850.com/tags/zhimeng_2.html
电脑站TAG伪静态实现教程
ALTER TABLE `qm_tagindex` ADD `filename` CHAR( 255 ) NOT NULL DEFAULT '';
点击下面链接下载文件,根据自己程序编码,选择pinyin.php文件,
放到网站根目录 链接: https://pan.baidu.com/s/18qtdpB6nKn714PeAoMAXpw 提取码: 8y8u pinyin.php
放到网站根目录后,在浏览器上打开
http://你的域名/pinyin.php
打开后文件会自动对已有的TAG标签生成拼音,完成即可,
以后添加文档或者TAG标签后不再需要执行它了,
。
$tid = $dsql->GetLastID();
在它下面加入
$pinyin = GetPinyin($tag); $shuzi = ''; $fnrow = $dsql->GetOne("SELECT id FROM `qm_tagindex` WHERE filename LIKE '$pinyin' ORDER BY id DESC LIMIT 1"); if(is_array($fnrow)) { $strarr = str_split($pinyin); $strend = $strarr[count($strarr) - 1]; $shuzi = is_numeric($strend) ? $strend+1 : 1; } $upquery = "UPDATE `qm_tagindex` SET `filename`='{$pinyin}{$shuzi}' WHERE id='$tid' "; $dsql->ExecuteNoneQuery($upquery);
$tag = FilterSearch(urldecode($tag));
在它
加入
$tag = reset(explode("_", $tag)); $PageNo = stripos(GetCurUrl(), '.html') ? intval(str_replace('.html', '', end(explode("_", GetCurUrl())))) : 1; $row = $dsql->GetOne("SELECT tag FROM `qm_tagindex` WHERE filename = '$tag' ORDER BY id DESC LIMIT 1"); if(is_array($row)) { $tag = $row['tag']; define('DEDERETAG', 'Y'); }
$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";
改成
$row['link'] = $cfg_cmsurl."/tags/".GetPinyin($row['tag']).".html";
$this->PageNo = $GLOBALS['PageNo'];
在它下面加入
if($this->PageNo == 0) { $this->PageNo = 1; }
继续找到
$purl .= "?/".urlencode($this->Tag);
改成
if(!defined('DEDERETAG')) { $purl .= "?/".urlencode($this->Tag); } else { $purl = $cfg_cmsurl."/tags/".GetPinyin($this->Tag); }
继续找到
return $plist;
在它
加入
if(defined('DEDERETAG')) { $plist = str_replace('.html', '', $plist); $plist = preg_replace("//(d+)//i",'_\1.html',$plist); $plist = preg_replace("/PageNo=(d+)/i",'_\1.html',$plist); }
RewriteEngine On RewriteBase / RewriteRule ^tags.html$ tags.php RewriteRule ^tags/(.*)_([0-9]+).html$ tags.php?/$1/$2 [L] RewriteRule ^tags/(.*)_([0-9]+).html$ tags.php?/$1/$2/ [L] RewriteRule ^tags/(.*).html$ tags.php?/$1 RewriteRule ^tags/(.*).html$ tags.php?/$1/
rewrite ^/tags.html$ /tags.php; rewrite ^/tags/(.*)-([0-9]+).html$ /tags.php?/$1/$2; rewrite ^/tags/(.*).html$ /tags.php?/$1;
打开 /dede/templets/tags_main.htm 找到 89行
改成
手机站TAG伪静态实现教程
链接: https://pan.baidu.com/s/1vRiO3H945IREFwImbHeNNw 提取码:n397
RewriteEngine On RewriteBase / RewriteRule ^tags.html$ tags.php RewriteRule ^tags/(.*)_([0-9]+).html$ tags.php?/$1/$2 [L] RewriteRule ^tags/(.*)_([0-9]+).html$ tags.php?/$1/$2/ [L] RewriteRule ^tags/(.*).html$ tags.php?/$1 RewriteRule ^tags/(.*).html$ tags.php?/$1/
rewrite ^/tags.html$ /tags.php; rewrite ^/tags/(.*)-([0-9]+).html$ /tags.php?/$1/$2; rewrite ^/tags/(.*).html$ /tags.php?/$1;
tag_m.htm taglist_m.htm