织梦DedeCMS手机站TAG伪静态实现教程

织梦技巧

此教程教大家设置织梦手机站点TAG标签伪静态,并且是单链接/id.html的形式。

1、m 文件夹添加tags.php文件给手机站使用

链接: https://pan.baidu.com/s/1hKCoCLOMrPsLRZY4g6paLw 提取码: jkh2 

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标签调用与电脑站一样

标签:
吃喝网尾部