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

请输入您要查询的范文:

 

标题 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/13 23:36:30