How to remove the domain name suffix index.html in the DEDECMS Dreamweaver template?

How to remove the domain name suffix index.html in the DEDECMS Dreamweaver template?

Friends who have just used DedeCMS to build websites may have noticed that our website domain name has a suffix of index.html. Many people don’t know what it is for and don’t care about it. However, you may not know that it affects the ranking of your website invisibly. Editor Feng Chao of Dongguan SEO also heard this at an offline exchange meeting. After coming back, I did several experiments and found that it was indeed the case. So how do we solve this problem? How to remove the domain name suffix index.html?

How to remove the domain name suffix index.html in the dedecms DreamWeaver template?

1. If the homepage does not need to generate HTML, log in to FTP and open index.php to change the original code (as follows):

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();
//Automatically generate HTML version
if(isset($_GET["upcache"]))
{
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"]);
echo $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");
}
?>
Replace all 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();
?>

2. The second method:

Many users want the top navigation link to facilitate SEO, and need to remove the "index.html" in the hyperlink. We can modify the tag here:

{dede:channel type="top"}
[field:typename/]
{/dede:channel}

3. The third method:

After the homepage is generated statically, change index.php to index.php_ or index-.php, etc., as you wish. As long as it is not index.php, it is OK.

How about it? Has the problem of how to cancel and remove the domain name suffix index.html in the dedecms DreamWeaver template been solved?

<<:  What is a dead link? What does a dead link mean?

>>:  How to do Baidu search drop-down box keywords and related searches?

Recommend

3 material optimization and analysis methods for information flow advertising!

The impact of advertising materials on advertisin...

2020 DaNei C/C++ Training

Introduction to 2020 Danai C/C++ training resourc...

New marketing method for increasing followers on Xiaohongshu

If you often browse Xiaohongshu, do you have this...

Learning copywriting is learning branding.

Last year there was a very controversial car adve...

2011-2016, what can we find from the best of Apple AppStore?

Apple AppStore has just announced the results of ...

Douyin store operation: Don’t cross these red line rules!

With the advent of the 5G era, ByteDance's qu...

Traffic doesn’t work? Member Economy to help you

"Prime has become the central nervous system...

How to promote user conversion? 99% of them used this trick~

Today, I want to share with you a trick to promot...

Paying for content, just old wine in new bottles?

Today I want to talk to you about the hottest top...

B station’s promotion beyond the circle!

On the road to breaking out of the circle, if Bil...

The process and channels for APP promotion and attracting new users!

Everyone has different ways and methods of operat...