php多域名跳转至目录

方法一:

<?php
switch ($_SERVER[ "HTTP_HOST"])
{
case “www.viyin.net“:
define(‘WP_USE_THEMES’, true);
require(‘./wp-blog-header.php’);
break;
case “viyin.net”:
define(‘WP_USE_THEMES’, true);
require(‘./wp-blog-header.php’);
break;
case “www.viyin.cn“:
define(‘WP_USE_THEMES’, true);
require(‘./wp-blog-header.php’);
break;
case “viyin.cn”:
define(‘WP_USE_THEMES’, true);
require(‘./wp-blog-header.php’);
break;
case “www.missur.cn“:
header(“location:/bbs”);
break;
case “missur.cn”:
header(“location:/bbs”);
break;    
case “www.missur.com“:
header(“location:/bbs”);
break;
case “missur.com”:
header(“location:/bbs”);
break;
default:
define(‘WP_USE_THEMES’, true);
require(‘./wp-blog-header.php’);
break;
}
?>

方法二:
<?php
switch ($_SERVER[ "HTTP_HOST"])
{
case "aaa.com":
header( "location:aaa.com");
break;
case "www.bbb.com":
header( "location:www.bbb.com");
break;
case "aii.net.ru":
header( "location:aii.net.ru");
break;
case "aii.org.ru":
header( "location:aii.org.ru");
break;
case "www.1111.com":
header( "location:www.1111.com");
break;
case "1111.com":
header( "location:1111.html");
break;
}
?>

你可能感兴趣的:(PHP,职场,域名,跳转,休闲)