网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的考试资料:

 

标题 dedecms织梦程序首页如何去除index.html
内容
    DEDECMS织梦CMS建站程序用户会发现,输入地址后,而打开的实际地址后面有个index.html,下面飞花如梦就和大家一起分享下这个问题的两种解决方法:
    1、把网站默认首页index.html放到index.php前面,这样它自动读到index.html就不会跳转了
    2、把DEDECMS的index.php更改为
    <?php   //自动生成HTML版       require_once (dirname(__FILE__) . "/include/common.inc.php");       require_once DEDEINC."/arc.partview.class.php";       $GLOBALS['_arclistEnv'] = 'index';       $row = $dsql->GetOne("Select * From `#@__homepageset`");       $row['templet'] = MfTemplet($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();   ?>
    <?php
    //自动生成HTML版
     require_once (dirname(__FILE__) . "/include/common.inc.php");
     require_once DEDEINC."/arc.partview.class.php";
     $GLOBALS['_arclistEnv'] = 'index';
     $row = $dsql->GetOne("Select * From `#@__homepageset`");
     $row['templet'] = MfTemplet($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();
    ?>
    其实主要就是把那段301定向代码删除
    header(‘HTTP/1.1 301 Moved Permanently’);
    header(‘Location:index.html’);
    以上两种方法绝对能解决dedecms首页地址不带index.html。
随便看

 

在线学习网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/20 7:23:42