濮阳杆衣贸易有限公司

主頁 > 網(wǎng)站建設(shè) > 建站知識(shí) > DedeCMS5.7列表 列表分頁 內(nèi)容頁 內(nèi)容分頁最新偽靜

DedeCMS5.7列表 列表分頁 內(nèi)容頁 內(nèi)容分頁最新偽靜

POST TIME:2019-09-30 11:46

DedeCMS V5.7 最新偽靜態(tài)規(guī)則 列表 列表分頁 內(nèi)容頁 內(nèi)容分頁

相信大家都在網(wǎng)上找到很多關(guān)于DEDE偽靜態(tài)規(guī)則 ,但是大家發(fā)現(xiàn)了沒有,列表分頁、 內(nèi)容分頁不能訪問,下面教大家怎么實(shí)現(xiàn)列表分頁、 內(nèi)容分頁偽靜態(tài)
操作如下:
1、后臺(tái)-系統(tǒng)參數(shù)-核心設(shè)置-是否使用偽靜態(tài):選擇“是”;
注:你的網(wǎng)站空間是否支持偽靜態(tài),你可以與空間的IDC商聯(lián)系一下,如果是自己的服務(wù)器,那就更好辦了,自己動(dòng)手,豐衣足食。一般來說,空間都是支持偽靜態(tài)的。Apache服務(wù)器偽靜態(tài)相對(duì)簡(jiǎn)單,直接在.htaccess文件中加入相應(yīng)偽靜態(tài)規(guī)則即可;而IIS服務(wù)器偽靜態(tài)的實(shí)現(xiàn),則需要加載Rewrite組件,然后配置httpd.ini文件。
2、如果你的網(wǎng)站已經(jīng)存在生成的靜態(tài)欄目或文章HTML,那么只需在后臺(tái)-系統(tǒng)-SQL命令行工具中執(zhí)行如下語句:

將所有文檔設(shè)置為“僅動(dòng)態(tài)瀏覽”:

updatedede_archives set ismake=-1

將所有欄目設(shè)置為“使用動(dòng)態(tài)頁”:

update dede_arctype set isdefault=-1

3、列表頁、文章頁偽靜態(tài)修改

打開/include/helpers/channelunit.helper.php。
(1)查找:
//動(dòng)態(tài)文章
if($cfg_rewrite == 'Y')
{
return $GLOBALS["cfg_plus_dir"]."/view-".$aid.'-1.html';
}
替換為
//動(dòng)態(tài)文章
if($cfg_rewrite == 'Y')
{
return "/DedeCMS/DedeCMS5.7-".$aid.'-1.html';
}
意思是:將默認(rèn)的/plus/view-1-1.html文章鏈接格式改為/DedeCMS/DedeCMS5.7-1-1.html。
(2) 查找:
//動(dòng)態(tài)
$reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;
替換為
//動(dòng)態(tài)
$reurl = "/category/list-".$typeid.".html";
意思是:將默認(rèn)的頻道或是列表頁URL/plus//list.php?tid=1變更為/dedecms/list-1.html形式。

4、列表分頁偽靜態(tài)修改

打開/include/arc.listview.class.php

查找:
$plist = str_replace('.php?tid=', '-', $plist);
替換為
$plist = str_replace('plus/list.php?tid=', ‘DedeCMS/DedeCMS5.7-', $plist);
將默認(rèn)的plus/list.php?tid=替換成RMB/list-;
意思是:將默認(rèn)的列表分頁鏈接格式plus/list.php?tid=x$x$xl修改為DedeCMS/DedeCMS5.7-x-x-x.html。
5、文章分頁偽靜態(tài)
打開/include/arc.archives.class.php,找到獲取動(dòng)態(tài)的分頁列表GetPagebreakDM()函數(shù)末尾處:
查找:
$PageList = str_replace("plus/view.php?tid=","DedeCMS/DedeCMS5.7-",$PageList);
替換為
$plist = str_replace('plus/view.php?tid=', ’DedeCMS/DedeCMS5.7-', $plist);

將默認(rèn)的plus/view.php?tid=替換成RMB/huilv-;
意思是:將默認(rèn)的文章分頁鏈接格式plus/view.php?tid=x$x$xl修改為DedeCMS/DedeCMS5.7-x-x-x.html

6、TAG標(biāo)簽偽靜態(tài)
DedeCms默認(rèn)的TAG標(biāo)簽URL,形如/tags.php?/dedecms模板/,是不是覺得有個(gè)問號(hào)不怎么爽,我們改成/tags/dedecms模板/,是不是好看多了。
下面我們來改一下,打開/include/taglib/tag.lib.php:
查找:
$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";
替換為
$row['link'] = $cfg_cmsurl."/tags/".urlencode($row['keyword'])."/";
這樣就修改好了,上傳你到你的網(wǎng)站,切記:要記得將原網(wǎng)站備份哦?。?br /> 7、httpd.ini偽靜態(tài)規(guī)則:

[ISAPI_Rewrite]

# 3600 = 1 hour
CacheClockRate 3600

RepeatLimit 32

RewriteRule ^(.*)/RMB/list-([0-9]+).html $1/plus/list.php?tid=$2 [I]
RewriteRule ^(.*)/RMB/list-([0-9]+)-([0-9]+)-([0-9]+).html $1/plus/list.php?tid=$2&TotalResult=$3&PageNo=$4 [I]
RewriteRule ^(.*)/RMB/huilv-([0-9]+)-([0-9]+).html $1/plus/view.php?arcID=$2&pageno=$3 [I]
RewriteRule ^(.*)/(.*)_(.*)_([0-9]+).html $1/huilv/?from=$2&to=$3&num=$4 [I]
RewriteRule ^(.*)/tags.html $1/tags.php [I]
RewriteRule ^(.*)/tags/(.*)(?:(?.*))* $1/tags.php?/$2 [I]
RewriteRule ^(.*)/tags/(.*)/(?:(?.*))* $1/tags.php?/$2/ [I]
RewriteRule ^(.*)/tags/(.*)/([0-9])(?:(?.*))* $1/tags.php?/$2/$3 [I]
RewriteRule ^(.*)/tags/(.*)/([0-9])/(?:(?.*))* $1/tags.php?/$2/$3/ [I]


將上面代碼保存為:httpd.ini 上傳到網(wǎng)站的根目錄

要用到.htaccess的自己找了,這里我就不寫出來了

 



收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
巴彦淖尔市| 拜泉县| 黎川县| 牡丹江市| 印江| 高要市| 会东县| 岗巴县| 平潭县| 宁武县| 大姚县| 浠水县| 沾益县| 云南省| 尉氏县| 天峨县| 庄河市| 略阳县| 临邑县| 临桂县| 兴国县| 洞口县| 张家界市| 北票市| 永平县| 隆回县| 大宁县| 科技| 尉犁县| 安多县| 和林格尔县| 石城县| 丰顺县| 报价| 达日县| 龙胜| 香港 | 岑巩县| 吴江市| 饶平县| 德保县|