Home CMS Tutorial DEDECMS dederemove index.html

dederemove index.html

May 26, 2021 am 10:55 AM
dede

dede method to remove index.html: 1. Replace the content of index.php to generate dynamics; 2. Directly delete the index.php file under the CMS root directory; 3. Use the htaccess file to remove index.html; 4. Set the default homepage order in the host.

dederemove index.html

The operating environment of this article: Windows 7 system, DedeCMS version 5.6, DELL G3 computer

After Dede generates the homepage by default, the link on the homepage will be followed by There is one more index.html. According to the official statement, this is beneficial to website optimization.

But this index.html is uncomfortable to look at, and it is not conducive to the unification of the homepage URL in SEO. Because the url of my website uses .htaccess to redirect to www, and ends with .com.

Therefore, in order to prevent the weight of the homepage from being dispersed, and also for aesthetic reasons, the index.html on the dede homepage must be removed.

The method for removing index.html from the dede homepage given on the Internet is as follows:

1. Replace the content of index.php according to the official update instructions to generate dynamics,

If There is no need to generate HTML for the homepage. Replace index.php with the following code

<?php
if(!file_exists(dirname(__FILE__).&#39;/data/common.inc.php&#39;))
{
header(&#39;Location:install/index.php&#39;);
exit();
}
require_once (dirname(__FILE__) . "/include/common.inc.php");
require_once DEDEINC."/arc.partview.class.php";
$GLOBALS[&#39;_arclistEnv&#39;] = &#39;index&#39;;
$row = $dsql->GetOne("Select * From `dede_homepageset`");
$row[&#39;templet&#39;] = MfTemplet($row[&#39;templet&#39;]);
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row[&#39;templet&#39;]);
$pv->Display();
?>
Copy after login

Of course, it will not work if you want to generate HTML.

2. 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 you can no longer use dynamic browsing after deleting it.

3. Use .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
Copy after login

It’s that simple.

4. Set the default homepage order in the host: bring index.html to the front.

Depending on the host, the setting method is also different. I won’t go into details.

Related recommendations: "dedecms tutorial"

The above is the detailed content of dederemove index.html. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)