婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 網(wǎng)站建設 > 建站知識 > dedecms5.7偽靜態(tài)怎么設置?dede5.7偽靜態(tài)設置方法七

dedecms5.7偽靜態(tài)怎么設置?dede5.7偽靜態(tài)設置方法七

POST TIME:2017-11-13 00:15

織夢內(nèi)容管理系統(tǒng)(DedeCms) 以簡單、實用、開源而聞名,是國內(nèi)最知名的PHP開源網(wǎng)站管理系統(tǒng),也是使用用戶最多的PHP類CMS系統(tǒng),dedecms5.7功能更強大和實用,但是一些朋友對dede5.7的偽靜態(tài)設置不是很熟悉,下面,心愿小編就為大家分享一下dede5.7偽靜態(tài)設置方法。

dede5.7偽靜態(tài)設置七步法:
第一步、后臺-系統(tǒng)參數(shù)-核心設置-是否使用偽靜態(tài):選擇“是”;
注:你的網(wǎng)站空間是否支持偽靜態(tài),你可以與空間的IDC商聯(lián)系一下,如果是自己的服務器,那就更好辦了,自己動手,豐衣足食。一般來說,空間都是支持偽靜態(tài)的。Apache服務器偽靜態(tài)相對簡單,直接在.htaccess文件中加入相應偽靜態(tài)規(guī)則即可;而IIS服務器偽靜態(tài)的實現(xiàn),則需要加載Rewrite組件,然后配置httpd.ini文件。

第二步、如果你的網(wǎng)站已經(jīng)存在生成的靜態(tài)欄目或文章HTML,那么只需在后臺-系統(tǒng)-SQL命令行工具中執(zhí)行如下語句:

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

update dede_archives set ismake=-1

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

update dede_arctype set isdefault=-1

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

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

第四步、列表分頁偽靜態(tài)修改

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

查找:
$plist = str_replace('.php?tid=', '-', $plist);
替換為
$plist = str_replace('plus/list.php?tid=', ‘DedeCMS/DedeCMS5.7-', $plist);
將默認的plus/list.php?tid=替換成RMB/list-;
意思是:將默認的列表分頁鏈接格式plus/list.php?tid=x$x$xl修改為DedeCMS/DedeCMS5.7-x-x-x.html。

第五步、文章分頁偽靜態(tài)
打開/include/arc.archives.class.php,找到獲取動態(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);

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

第六步、TAG標簽偽靜態(tài)
DedeCms默認的TAG標簽URL,形如/tags.php?/dedecms模板 /,是不是覺得有個問號不怎么爽,我們改成/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)站備份哦!!

第七步、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)站的根目錄。
如無特特殊需求建議采用官方默認的生成靜態(tài)的頁面方式瀏覽。



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

  • 400-1100-266
主站蜘蛛池模板: 洛扎县| 车致| 蒙城县| 仁寿县| 深州市| 察隅县| 太和县| 丽江市| 莆田市| 易门县| 四川省| 唐山市| 鹰潭市| 明溪县| 泸州市| 昌平区| 绩溪县| 什邡市| 郴州市| 淳安县| 望谟县| 盐津县| 湛江市| 汶川县| 禹州市| 永春县| 陕西省| 美姑县| 泽库县| 彭水| 伊金霍洛旗| 温州市| 凤山县| 平和县| 宝兴县| 花垣县| 新化县| 应城市| 永善县| 宜都市| 南丰县|