dedecms 5.5版后臺(tái)可以開(kāi)啟偽靜態(tài)功能,但是就只文章頁(yè)會(huì)被偽靜態(tài),欄目頁(yè)的鏈接依然是動(dòng)態(tài)的,我們首先需要給虛擬主機(jī)添加上偽靜態(tài)規(guī)則,然后再去dedecms的相關(guān)文件中改掉相應(yīng)的函數(shù),首先我們給虛擬主機(jī)加上偽靜態(tài)規(guī)則,Apache和IIS的詳細(xì)設(shè)置如下,虛擬主機(jī)是否支持偽靜態(tài),請(qǐng)咨詢(xún)你的虛擬主機(jī)提供商.
如果是Apache的服務(wù)器,就在.htaccess里面寫(xiě)上如下代碼:
- <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule index.html /index.php
- RewriteRule plus/list-([0-9]+).html$ /plus/list.php?tid=$1
- RewriteRule plus/view-([0-9]+)-([0-9]+).html$ /plus/view.php?arcID=$1&pageno=$3 //開(kāi)源軟件:Vevb.com
- RewriteRule plus/list-([0-9]+)-([0-9]+)-([0-9]+).html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3
- </IfModule>
IIS的服務(wù)器,在httpd.ini里面寫(xiě)上,前提是要服務(wù)器安裝過(guò)ISAPI Rewrite
[ISAPI_Rewrite]
# 緩存3600秒 = 1 小時(shí)(hour)
代碼如下:
- CacheClockRate 3600
- RepeatLimit 32
- RewriteRule ^(.*)/index.html $1/index.php
- RewriteRule ^(.*)/plus/list-([0-9]+).html $1/plus/list.php?tid=$2
- RewriteRule ^(.*)/plus/list-([0-9]+)-([0-9]+)-([0-9]+).html $1/plus/list.php?tid=$2&TotalResult=$3&PageNo=$4
- RewriteRule ^(.*)/plus/view-([0-9]+)-([0-9]+).html $1/plus/view.php?arcID=$2&pageno=$3
然后我們修改dedecms的程序,打開(kāi)includechannelunit.func.php,代碼如下:
- $reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;
- //替換為如下:
- $reurl = $GLOBALS['cfg_phpurl']."/list-".$typeid.".html";
新聞熱點(diǎn)
疑難解答
圖片精選