POST TIME:2017-11-30 16:42
在使用織夢cms做網(wǎng)站的時候,你一定會發(fā)現(xiàn)這么一個問題,數(shù)據(jù)庫特別大的時候,尤其上萬條數(shù)據(jù),更新起來會特別慢,甚至好幾個小時,如何實現(xiàn)文章不用更新,發(fā)表就可以看到效果呢,使用動態(tài)化,怎么由動態(tài)轉(zhuǎn)化成靜態(tài)呢?
1,首先,首頁動態(tài)化
我們只要把網(wǎng)站根目錄下面生成的index.html刪除,
然后把index.php里面的代碼修改成
if(!file_exists(dirname(__FILE__).'/data/common.inc.php'))
{
header('Location:install/index.php');
exit();
}
require_once (dirname(__FILE__) . "/include/common.inc.php");
require_once DEDEINC."/arc.partview.class.php";
$GLOBALS['_arclistEnv'] = 'index';
$row = $dsql->GetOne("Select * From `dede_homepageset`");
$row['templet'] = MfTemplet($row['templet']);
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
$pv->Display();
?>
。如果想實現(xiàn)首頁動態(tài)效果以后就不能再在后臺更新網(wǎng)站了。更新后首頁又變成靜態(tài)的了。
· 2,將織夢所有欄目設(shè)置為“使用動態(tài)頁”,可以再建立欄目時選擇“使用動態(tài)頁”;
也可以執(zhí)行下面的SQL語句。
update dede_arctype set isdefault=-1
3,將網(wǎng)站所有文檔都設(shè)置為“僅動態(tài)”
執(zhí)行下面的SQL語句;
update dede_archives set ismake=-1
找到 系統(tǒng)-SQL命令行工具 然后執(zhí)行sql命令即可;