名站网址导航为大驾家提供DedeCMS站点程序站点教程相关的知识,比如织梦程序安装教程,织梦程序系统故障等教程。
无论你站点全站是静态网站网页或者动态还是伪静态网站网页,此教程都可以设置TAG标签页为伪静态网站网页,并且是单链接汉字名称的形式
按此教程操作后,电脑站TAG标签url会像如下:
TAG标签首页 https://www.mzdh.net/tags.html
TAG标签站点列表 https://www.mzdh.net/tags/织梦程序.html
TAG标签分页 https://www.mzdh.net/tags/织梦程序_2.html
TAG标签首页 https://m.www.mzdh.net.com/tags.html
TAG标签站点列表 https://m.www.mzdh.net.com/tags/织梦程序.html
TAG标签分页 https://m.www.mzdh.net.com/tags/织梦程序_2.html
电脑站TAG伪静态网站网页实现教程
1、/tags.php 找到 18行
if(isset($tags[2])) $PageNo = intval($tags[2]);
在它下面加入
define('DEDERETAG', 'Y');
2、/include/taglib/tag.lib.php 找到 87行
$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";
改成
$row['link'] = $cfg_cmsurl."/tags/".urlencode($row['keyword']).".html";
3、/include/arc.taglist.class.php 找到 458行
$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','_.html',$plist); } |
4、电脑站TAG标签伪静态网站网页规则,根据自己站点的主机系统环境选择下面的规则
.htaccess (Apache)
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/ |
Nginx
rewrite "^/tags.html$"/tags.php; rewrite "^/tags/(.*)_([0-9] ).html$"/tags.php?/$1/$2/ last; rewrite "^/tags/(.*).html$"/tags.php?/$1/; |
web.config (iis7 iis8)
<rule name="tag首页"> <match url="^tags.html$" ignoreCase="false" /> <action type="Rewrite" url="tags.php" appendQueryString="false" /> </rule> <rule name="tag站点列表分页"> <match url="^tags/(.*)_([0-9] ).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}" appendQueryString="false" /> </rule> <rule name="tag站点列表分页最后有左斜杠"> <match url="^tags/(.*)_([0-9] ).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}/" appendQueryString="false" /> </rule> <rule name="tag站点列表"> <match url="^tags/(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}" appendQueryString="false" /> </rule> <rule name="tag站点列表最后有左斜杠"> <match url="^tags/(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/" appendQueryString="false" /> </rule> |
如需网站的后台TAG标签管理里的TAG链接点击打开也是伪静态网站网页可这样改
打开 /dede/templets/tags_main.htm 找到 89行
<a href="../tags.php?/<?php echo urlencode($fields['tag']); ?>/" target="_blank">{dede:field.tag /}</a>
改成
<a href="../tags/<?php echo urlencode($fields['tag']); ?>.html" target="_blank">{dede:field.tag /}</a>
手机站TAG伪静态网站网页实现教程
1、m 网站文件夹添加tags.php网站文件给手机站使用
附下载地址:
织梦程序手机站TAG标签伪静态网站网页-添加tags.php网站文件.zip |
2、手机站TAG标签伪静态网站网页规则,根据自己站点的主机系统环境选择下面的规则
.htaccess (Apache 放到m网站文件夹下)
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/ |
Nginx
rewrite "^/tags.html$"/tags.php; rewrite "^/tags/(.*)_([0-9] ).html$"/tags.php?/$1/$2/ last; rewrite "^/tags/(.*).html$"/tags.php?/$1/; |
web.config (iis7 iis8)
<rule name="tag首页"> <match url="^tags.html$" ignoreCase="false" /> <action type="Rewrite" url="tags.php" appendQueryString="false" /> </rule> <rule name="tag站点列表分页"> <match url="^tags/(.*)_([0-9] ).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}" appendQueryString="false" /> </rule> <rule name="tag站点列表分页最后有左斜杠"> <match url="^tags/(.*)_([0-9] ).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/{R:2}/" appendQueryString="false" /> </rule> <rule name="tag站点列表"> <match url="^tags/(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}" appendQueryString="false" /> </rule> <rule name="tag站点列表最后有左斜杠"> <match url="^tags/(.*).html$" ignoreCase="false" /> <action type="Rewrite" url="/tags.php?/{R:1}/" appendQueryString="false" /> </rule> |
3、手机站TAG标签首页和TAG标签站点列表页模板为
tag_m.htm
taglist_m.htm
4、TAG标签具体调用与电脑站一样
关于DedeCMS站点程序站点教程相关的知识,就说到这里了希望能帮助朋友们。织梦程序会员中心投稿编辑器修改