Home >CMS Tutorial >DEDECMS >How to remove index.html in DreamWeaver

How to remove index.html in DreamWeaver

藏色散人
藏色散人Original
2021-05-12 15:10:373571browse

How to remove index.html from DreamWeaver: First open the index.PHP file in the root directory of DEDECMS; then replace the content with "if(!file_exists(dirname(__FILE__).'/data/common.inc. php')){..}" will do.

How to remove index.html in DreamWeaver

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

Remove the suffix index from the homepage of the website for Dreamweaver cms .html method

The search engine will think that / and /index.htm are two different pages. Enter the domain name and it will be redirected to www.dede58.com/index.html immediately, so the path changes. It is long, not conducive to SEO, and will also disperse the weight. After the default DEDECMS homepage is generated statically, when we open the website we built using DEDECMS, the index.html path will be added after the domain name. First of all, it is not very beautiful. Secondly, the rumors are wrong. SEO has an impact.

The simplest and best way is to replace all the code in index.PHP in the root directory of DEDECMS with the following:

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

After replacement, clear your browser Cache, then open it again to see if there is no index.html. If you have any questions, please contact me.

If you don’t want to use the above method, take Wanwang Virtual Host as an example (picture below): Move the default homepage index.htm to the top, highest priority, save the settings, and go to the website When the home page is updated in the background, there will be no index.html.

How to remove index.html in DreamWeaver

Recommended study: "dedecms tutorial"

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

Statement:
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