织梦电脑站手机站TAG标签伪静态拼音版(2)

  tags文件  

2、手机站TAG标签伪静态规则,根据自己网站的主机环境选择下面的规则

.htaccess (Apache 放到m文件夹下)

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\/

Nginx

rewrite ^/tags\.html$ /tags.php;

rewrite ^/tags/(.*)-([0-9]+)\.html$  /tags.php?\/$1\/$2;

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

如果你在首页/列表页调用TAG

示例写法

[field:id runphp=yes]

global $dsql,$cfg_cmsurl;

$tags = '';

$query = "SELECT l.tag,i.filename FROM `dede_taglist` l LEFT JOIN `dede_tagindex` i ON l.tid=i.id WHERE l.aid='@me' ";

$dsql->Execute('tag',$query);

while($row = $dsql->GetArray('tag'))

{

$tags .= "<a href=\"{$cfg_cmsurl}/tags/{$row['filename']}.html\">{$row['tag']}</a> ";

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wsfdzf.html