国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 織夢DEDE > 正文

織夢電腦站手機(jī)站TAG標(biāo)簽偽靜態(tài)-漢字名稱版

2024-07-12 09:08:05
字體:
供稿:網(wǎng)友

無論你網(wǎng)站全站是靜態(tài)或者動態(tài)還是偽靜態(tài),此教程都可以設(shè)置TAG標(biāo)簽頁為偽靜態(tài),并且是單鏈接漢字名稱的形式

按此教程操作后,電腦站TAG標(biāo)簽url會像如下:

TAG標(biāo)簽首頁 https://www.CUOxin.com/tags.html

TAG標(biāo)簽列表 https://www.CUOxin.com/tags/織夢.html

TAG標(biāo)簽分頁 https://www.CUOxin.com/tags/織夢_2.html

按此教程操作后,手機(jī)站TAG標(biāo)簽url會像如下:

TAG標(biāo)簽首頁 https://m.CUOxin.com/tags.html

TAG標(biāo)簽列表 https://m.CUOxin.com/tags/織夢.html

TAG標(biāo)簽分頁 https://m.CUOxin.com/tags/織夢_2.html

 

電腦站TAG偽靜態(tài)實(shí)現(xiàn)教程

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";}

繼續(xù)找到

return $plist;

在它上面加入

 

if(defined('DEDERETAG')){$plist = preg_replace('/_(d+).html/i','.html',$plist);$plist = preg_replace('/.html/(d+)//i','_.html',$plist);}

4、電腦站TAG標(biāo)簽偽靜態(tài)規(guī)則,根據(jù)自己網(wǎng)站的主機(jī)環(huán)境選擇下面的規(guī)則

.htaccess (Apache)

 

RewriteEngine OnRewriteBase /RewriteRule ^tags.html$tags.phpRewriteRule ^tags/(.*)_([0-9]+).html$tags.php?/$1/$2RewriteRule ^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標(biāo)簽管理里的TAG鏈接點(diǎn)擊打開也是偽靜態(tài)可這樣改

打開 /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>

 

手機(jī)站TAG偽靜態(tài)實(shí)現(xiàn)教程

1、m 文件夾添加tags.php文件給手機(jī)站使用

附下載地址:

織夢手機(jī)站TAG標(biāo)簽偽靜態(tài)-添加tags.php文件.zip

2、手機(jī)站TAG標(biāo)簽偽靜態(tài)規(guī)則,根據(jù)自己網(wǎng)站的主機(jī)環(huán)境選擇下面的規(guī)則

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

 

RewriteEngine OnRewriteBase /RewriteRule ^tags.html$tags.phpRewriteRule ^tags/(.*)_([0-9]+).html$tags.php?/$1/$2RewriteRule ^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、手機(jī)站TAG標(biāo)簽首頁和TAG標(biāo)簽列表頁模板為

tag_m.htm

taglist_m.htm

4、TAG標(biāo)簽調(diào)用與電腦站一樣

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 会东县| 隆化县| 龙井市| 中江县| 汶上县| 宽城| 马边| 长海县| 耒阳市| 渝北区| 涿鹿县| 葵青区| 合肥市| 蒙山县| 邵东县| 岫岩| 青阳县| 合阳县| 城市| 土默特右旗| 贵南县| 永川市| 江川县| 绥德县| 班玛县| 鄂托克旗| 应城市| 谷城县| 龙岩市| 深圳市| 长顺县| 雅安市| 达孜县| 屯留县| 福安市| 仁怀市| 云南省| 南丹县| 安岳县| 舞阳县| 罗定市|