我們在使用織夢偽靜態(tài)的時候,發(fā)現(xiàn)織夢的后臺是可以開啟偽靜態(tài)功能的,但僅僅是文章頁的偽靜態(tài)會被開啟,欄目頁的鏈接依然是動態(tài)的。那么如果要想讓欄目頁也使用偽靜態(tài)我們需要如何設(shè)置呢?
本文織夢模板網(wǎng)舊介紹下如何開啟欄目頁偽靜態(tài)的方法。
首先,需要給虛擬主機(jī)添加上偽靜態(tài)規(guī)則,然后再去織夢dedecms的相關(guān)文件中改掉相應(yīng)的函數(shù)。
下面武林網(wǎng)分別給出Apache和IIS的詳細(xì)設(shè)置方法。
Apache的服務(wù)器,就在.htaccess中添加:
<IfModule mod_rewrite.c>RewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule index.html /index.phpRewriteRule plus/list-([0-9]+).html$ /plus/list.php?tid=$1RewriteRule plus/view-([0-9]+)-([0-9]+).html$ /plus/view.php?arcID=$1&pageno=$3RewriteRule plus/list-([0-9]+)-([0-9]+)-([0-9]+).html$ /plus/list.php?tid=$1&totalresult=$2&PageNo=$3</IfModule>IIS的服務(wù)器,在httpd.ini中添加如下內(nèi)容,需要服務(wù)器安裝過ISAPI Rewrite:
[ISAPI_Rewrite]# 緩存3600秒 = 1 小時(hour)CacheClockRate 3600RepeatLimit 32RewriteRule ^(.*)/index.html $1/index.phpRewriteRule ^(.*)/plus/list-([0-9]+).html $1/plus/list.php?tid=$2RewriteRule ^(.*)/plus/list-([0-9]+)-([0-9]+)-([0-9]+).html $1/plus/list.php?tid=$2&TotalResult=$3&PageNo=$4RewriteRule ^(.*)/plus/view-([0-9]+)-([0-9]+).html $1/plus/view.php?arcID=$2&pageno=$3
然后我們再來介紹下,如何修改dedecms的程序。
打開include/channel/unit.func.php。
將以下代碼:
$reurl = $GLOBALS['cfg_phpurl']."/list.php?tid=".$typeid;
替換為:
$reurl = $GLOBALS['cfg_phpurl']."/list-".$typeid.".html";
新聞熱點(diǎn)
疑難解答
圖片精選