tanlingdangan

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,大家参考用之。

分类:

技术点:

相关文章:

  • 2021-04-15
  • 2021-09-04
  • 2021-07-02
  • 2021-11-17
  • 2021-08-13
  • 2021-11-17
  • 2021-09-23
猜你喜欢
  • 2021-11-17
  • 2021-10-03
  • 2021-07-21
  • 2021-08-31
  • 2021-08-17
  • 2021-12-14
  • 2021-06-28
相关资源
相似解决方案