两种方法解决:
第一种:就是前面讲到的在服务器里面或者你购买的虚拟主机的后台将网站的默认首页设置为index.html。
第二种:如果购买的虚拟主机后台没有网站默认首页设置,那就要修改网站根目录的index.php文件。
打开index.php文件,将里面的全部内容替换为下面的代码:
if(!file_exists(dirname(__FILE__).'/data/common.inc.php'))
{
header('Location:install/index.php');
exit();
}
require_once (dirname(__FILE__) . "/include/common.inc.php");
require_once DEDEINC."/arc.partview.class.php";
$GLOBALS['_arclistEnv'] = 'index';
$row = $dsql->GetOne("Select * From `dede_homepageset`");
$row['templet'] = MfTemplet($row['templet']);
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" .
$row['templet']);
$pv->Display();
?>
在你的主机控制管理里设置一下默认首页为“index.html”就没有了。
方法如下:
在根目录的.htaccess里加入以下代码:
DirectoryIndex index.html index.php index.htm
就这么简单。