dede method to remove html: 1. Directly delete the index.php file under the CMS root directory; 2. Add the code "DirectoryIndex index.html index.php index.htm" to the .htaccess in the root directory; 3. , set the default homepage order in the host; 4. Replace the content of index.php to generate dynamics.
The operating environment of this article: Windows 7 system, DedeCMS version 5.6, DELL G3 computer
How to remove html from dede?
dedecms generates index.html through the background by default. There are 4 ways to remove it
1. Directly delete the index.php file under the CMS root directory [This method seems to be the simplest , but I tried it myself but failed, and after deleting it, I couldn’t use dynamic browsing]
2. Use the .htaccess file. This method is currently used and the test was successful.
The method is as follows: Add the following code to .htaccess in the root directory: DirectoryIndex index.html index.php index.htm [Suggestion]
3. Set the default homepage order in the host: index.html is mentioned at the front. There are different configuration methods according to different hosts.
4. Follow the official update instructions to replace the content of index.php to generate dynamics. If the homepage does not need to generate HTML, replace index.php with the following code
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(); ?> 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(); ?>
Related recommendations: " dedecms tutorial》
The above is the detailed content of How to remove html from dede. For more information, please follow other related articles on the PHP Chinese website!