?????????????????DedeCMS??301????????÷?????????????????ο????????????????£?
????301?????????????????????????????????????????????www??????????www???????????????????301????????????????????? ??????????301????????????????????????????www???????????????????dedecms???÷????????????????????????????.
???????Linux???????????301?????
????1????????????±???????????“???”--“????”??“????????”???“???????”???????? .htaccess ????????????????????????????.
????2???ü??±??????????? .htaccess ???????????????????:
????Options +FollowSymLinks
????RewriteEngine on
????rewritecond %{http_host} ^phpfensi[nc]
????rewriterule ^(.*)$ http://www.jb51.net/$1 [r=301??nc]
????3????????滻??????????????????????????????????????????????IE???????????????????????www???????.
????????Windows???????????301????????html????????????????滻????????? index.php ?????????????:
<?php
$HOST=$_SERVER['HTTP_HOST'];
if ($HOST=="429006.com"|| $HOST==www.jb51.net"{
Header("HTTP/1.1 301 Moved Permanently");
Header("Location:http://www.jb51.net");
exit();
}
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();
?>
???????????????????:
<?php
$jump301=1;//?????301????????1?? 0??
$index_file='index.html';//?????? ?????SSI??shtml/shtm??
if(substr($_SERVER['SERVER_NAME']??0??4)!='www.'&&$jump301)
{
header('HTTP/1.1 301 Moved Permanently');
header('Location:http://www.'.$_SERVER['SERVER_NAME']);
exit();
}
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_file);
include(dirname(__FILE__).'/'.$index_file);
exit();
}
include(dirname(__FILE__).'/'.$index_file);
?>
???????:????????????????????301??????????????????
????????????????????dedecms?????????????