DEDECMS首页自动生成静态文件index.html

    xiaoxiao2021-03-26  7

    织梦没有自动生成静态首页文件index.html ,这样如果不小心删除了index.html而又没有在后台生成,那么访问网站,则会出现首页404错误。 <?php if(!file_exists(dirname(__FILE__).'/data/common.inc.php')) { header('Location:install/index.php'); exit(); } //自动生成HTML版,加上 //!file_exists(dirname(__FILE__).'/index.html'),如果不存在index.html,则自动生成index.html if(isset($_GET['upcache']) || !file_exists(dirname(__FILE__).'/index.html')) { 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->SaveToHtml(dirname(__FILE__).'/index.html'); include(dirname(__FILE__).'/index.html'); exit(); } else { header('HTTP/1.1 301 Moved Permanently'); header('Location:index.html'); } ?>
    转载请注明原文地址: https://ju.6miu.com/read-500129.html

    最新回复(0)