DEDE程序做301重定向方法小结:
第一步:把DedeCMS根目录下index.php原文件换成以下内容:
<?php
$HOST=$_SERVER['HTTP_HOST'];if($HOST=="yongyanba.com"||$HOST=="piminjie520.082.xindns.org"){Header("HTTP/1.1 301 Moved Permanently");Header("Location:http://www.goldlek.com");exit();}if(!file_exists(dirname(__FILE__).'/data/common.inc.php')){header('Location:install/index.php');exit();}//自动生成HTML版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=newPartView();$pv->SetTemplet($cfg_basedir.$cfg_templets_dir."/".$row['templet']);$pv->Display();?>
上传并覆盖。
第二步:进入空间控制面版,把默认首页更改成index.php,刷新即可看到301重定向的效果。