鬂已星星也 發表於 2024-1-8 00:00:00

织梦建站访问首页时后面都会添加上index.html该如何去掉

<span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>很多朋友在使用织梦建站或者仿站时都会发现,在访问首页时后面都会添加上index.html </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>现在我就把这解决办法分享出来,大家可以试一试,看有没有用 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>在www/ 跟目录下有个自带的index.php文件 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>原代码 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
        <div class="right">
                <span><u>复制代码</u></span>
</div>
        代码如下:</div>
<div class="msgborder" id="phpcode4" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
        <br>
        //自动生成HTML版 <br>
        if(isset($_GET['upcache'])) <br>
        { <br>
        require_once (dirname(__FILE__) . "/include/common.inc.php"); <br>
        require_once DEDEINC."/arc.partview.class.php"; <br>
        $GLOBALS['_arclistEnv'] = 'index'; <br>
        $row = $dsql-&gt;GetOne("Select * From `dede_homepageset`"); <br>
        $row['templet'] = MfTemplet($row['templet']); <br>
        $pv = new PartView(); <br>
        $pv-&gt;SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']); <br>
        $pv-&gt;SaveToHtml(dirname(__FILE__).'/index.html'); <br>
        include(dirname(__FILE__).'/index.html'); <br>
        exit(); <br>
        } <br>
        else <br>
        { <br>
        header('HTTP/1.1 301 Moved Permanently'); <br>
        header('Location:index.html'); <br>
        } <br>
        ?&gt; </div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>把上面的代码替换为 </span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
        <div class="right">
                <span><u>复制代码</u></span>
</div>
        代码如下:</div>
<div class="msgborder" id="phpcode5" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
        <br>
        require_once (dirname(__FILE__) . "/include/common.inc.php"); <br>
        require_once DEDEINC."/arc.partview.class.php"; <br>
        $GLOBALS['_arclistEnv'] = 'index'; <br>
        $row = $dsql-&gt;GetOne("Select * From `dede_homepageset`"); <br>
        $row['templet'] = MfTemplet($row['templet']); <br>
        $pv = new PartView(); <br>
        $pv-&gt;SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']); <br>
        $pv-&gt;Display(); <br>
        ?&gt; </div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>然后就可以了。</span>
頁: [1]
查看完整版本: 织梦建站访问首页时后面都会添加上index.html该如何去掉