无论你网站全站是静态或者动态还是伪静态,此教程都可以设置TAG标签页为伪静态,并且是单链接名称的形式 按此教程操作后,电脑站TAG标签url会像如下:
TAG标签首页 http://www.m1850.com/tags.html TAG标签列表 http://www.m1850.com/tags/织梦.html TAG标签分页 http://www.m1850.com/tags/织梦_2.html 按此教程操作后,手机站TAG标签url会像如下:
TAG标签首页 http://m.m1850.com/tags.html TAG标签列表 http://m.m1850.com/tags/织梦.html TAG标签分页 http://m.m1850.com/tags/织梦_2.html 电脑站TAG伪静态实现教程
if(isset($tags[2])) $PageNo = intval($tags[2]);
在它下面加入
define('DEDERETAG', 'Y');
$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";
改成
$row['link'] = $cfg_cmsurl."/tags/".urlencode($row['keyword']).".html";
$purl .= "?/".urlencode($this->Tag);
改成
if(!defined('DEDERETAG')) { $purl .= "?/".urlencode($this->Tag); } else { $purl = $GLOBALS['cfg_cmsurl']."/tags/".urlencode($this->Tag).".html"; }
继续找到
return $plist;
在它
加入
if(defined('DEDERETAG')) { $plist = preg_replace('/_(d+).html/i','.html',$plist); $plist = preg_replace('/.html/(d+)//i','_\1.html',$plist); }
RewriteEngine On RewriteBase / RewriteRule ^tags.html$ tags.php RewriteRule ^tags/(.*)_([0-9]+).html$ tags.php?/$1/$2 RewriteRule ^tags/(.*)_([0-9]+).html$ tags.php?/$1/$2/ RewriteRule ^tags/(.*).html$ tags.php?/$1 [L] RewriteRule ^tags/(.*).html$ tags.php?/$1/
rewrite "^/tags.html$" /tags.php; rewrite "^/tags/(.*)_([0-9]+).html$" /tags.php?/$1/$2/ last; rewrite "^/tags/(.*).html$" /tags.php?/$1/;
打开 /dede/templets/tags_main.htm 找到 89行
改成
手机站TAG伪静态实现教程
链接: https://pan.baidu.com/s/1X0iwVAeFXd8mjwICi9MFjA 提取码: emjm
RewriteEngine On RewriteBase / RewriteRule ^tags.html$ tags.php RewriteRule ^tags/(.*)_([0-9]+).html$ tags.php?/$1/$2 RewriteRule ^tags/(.*)_([0-9]+).html$ tags.php?/$1/$2/ RewriteRule ^tags/(.*).html$ tags.php?/$1 [L] RewriteRule ^tags/(.*).html$ tags.php?/$1/
rewrite "^/tags.html$" /tags.php; rewrite "^/tags/(.*)_([0-9]+).html$" /tags.php?/$1/$2/ last; rewrite "^/tags/(.*).html$" /tags.php?/$1/;
tag_m.htm taglist_m.htm