zoukankan      html  css  js  c++  java
  • dedecms中去除首页index.html的方法

    本文介绍了dedecms中去除首页index.html的方法,有需要的朋友参考下。

    dedecms织梦cms建站程序输入地址后,而打开的实际地址后面有个index.html。
     
    这里分享下两种解决方法:
     
    1、把网站默认首页index.html放到index.php前面,即配置好默认首页即可解决。
     
    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();
    ?>
     
    就是把那段301定向代码删除:
     
     
    header(‘http/1.1 301 moved permanently’);
    header(‘location:index.html’);
    以上二种方法,均可实现dedecms首页地址不带index.html,大家参考用之。
  • 相关阅读:
    python 购物车和三级菜单
    python-装饰器
    day3 python 函数
    day3 python 集合 文件
    two day python基础知识
    python-day 1
    Cordova 环境搭建
    javascript在html直接传值
    JavaScript疑难点
    Javascript创建对象的方法
  • 原文地址:https://www.cnblogs.com/tanlingdangan/p/3800702.html
Copyright © 2011-2022 走看看