织梦首页php301重定向

来源:互联网 发布:iphone手机主题软件 编辑:程序博客网 时间:2024/05/23 11:08
<?php $jump301=1;//是否开301跳转开关,1开 0关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(); } //自动生成HTMLif(isset($_GET['upcache']) || !file_exists('index.html')){    require_once (dirname(__FILE__) . "/include/common.inc.php");    require_once DEDEINC."/arc.partview.class.php";    $GLOBALS['_arclistEnv'] = 'index';    $row = $dsql->GetOne("Select * From `#@__homepageset`");    $row['templet'] = MfTemplet($row['templet']);    $pv = new PartView();    $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);    $row['showmod'] = isset($row['showmod'])? $row['showmod'] : 0;    if ($row['showmod'] == 1)    {        $pv->SaveToHtml(dirname(__FILE__).'/index.html');        include(dirname(__FILE__).'/index.html');        exit();    } else {         $pv->Display();        exit();    }}else{    header('HTTP/1.1 301 Moved Permanently');    header('Location:index.html');}?>        
0 0
原创粉丝点击