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 `); $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 `);
$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。
中国足彩网信息请查看IT技术专栏