How to delete index.html path on dedecms homepage

After the default DEDECMS homepage is static, when you open the website built by DEDECMS we will add the index.html path after the domain name. At first glance, it is not very beautiful, but rumors have an impact on SEM.

Then you have to find a way to remove it. The easiest way is to replace all the codes in INDEX.PHP in the root directory of DEDECMS with the following:

<?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(); ?>

It's that simple, just replace it. Clear your browser cache, and then open it again to see if INDEX.HTML is gone

Guess you like

Origin blog.csdn.net/a9490489/article/details/107894845