織夢dede去掉首頁index.html |
發(fā)布時間: 2012/9/17 15:00:38 |
我們在用DEDE做站的時候,往往完成了站點之后就是SEO優(yōu)化了,但是,你們會到這種問題,那就是首頁的域名上會出現(xiàn)后面帶有index.html的字樣,很多人不知道怎么去掉,其實很簡單,今天北京SEO教你去掉index.html,很簡單的哦!只需要改動根目錄下的index.php文件。
首先放上網(wǎng)站首頁index.php的原代碼,看下面:
<?php
if(!file_exists(dirname(__FILE__).’/data/common.inc.php’))
{
header(‘Location:install/index.php’);
exit();
}
//自動生成HTML版
if(isset($_GET['upcache']))
{
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->SaveToHtml(dirname(__FILE__).’/index.html’);
include(dirname(__FILE__).’/index.html’);
exit();
}
else
{
header(‘HTTP/1.1 301 Moved Permanently’);
header(‘Location:index.html’);
}
?>
替換為
<?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();
?>
很簡單吧,一看你就會了,呵呵,北京SEO教程時間就到這里了~ 下一節(jié)繼續(xù)講關(guān)于Dede的問題,盡請關(guān)注! 本文出自:億恩科技【mszdt.com】 |