ECSHOP 301重新定向
这里的讲解以ecshop v2.7.3正式版为例,在includes目录下新建 cls_301.php
<?php $the_host = $_SERVER['HTTP_HOST']; $request_uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : ''; if($the_host !== 'http://www.phpfensi.com/') //判断是否是新的网址如果不是 { header('HTTP/1.1 301 Moved Permanently'); header('Location: http://www.phpfensi.com/'.$request_uri); //重新定向到新的网址 } ?>
第二步,修改includes/init.php,大概在74行上添加:
require(ROOT_PATH . 'includes/cls_301.php');
修改后为:
define('PHP_SELF', $php_self); require(ROOT_PATH . 'includes/cls_301.php'); //二次开发自定义 301跳转 require(ROOT_PATH . 'includes/inc_constant.php'); require(ROOT_PATH . 'includes/cls_ecshop.php'); require(ROOT_PATH . 'includes/cls_error.php'); require(ROOT_PATH . 'includes/lib_time.php'); require(ROOT_PATH . 'includes/lib_base.php');
标签:
还没有评论,快来说点什么吧~