// Install info.:
// Copy and paste these lines into your default index.php or
// the file that get's called if a visitor comes on your
// website...
// read the host from the server environment
$host = $_SERVER["HTTP_HOST"];
// fix host name - we never now... ;-)
$host = strtolower($host);
$host = trim($host);
// This is important:
// Webbrowsers like Firefox are doing their request without
// the port number like "www.1sucai.cn" but some other
// applications send host names like "www.1sucai.cn:80"
$host = str_replace(':80', '', $host);
$host = trim($host);
// if the host is not starting with www. redirect the
// user to the same URL but with www :-)
if ($host != 'www.1sucai.cn'){
// You an also change the "!=" to "==", if you want to force
// the user to use the domain name without the www.
// send status header, so that search engines or other services
// detect that this is a permanent redirect and not a temporary
header('HTTP/1.1 301 Moved Permanently');
// read the URL the user requested:
$url = isset($_SERVER["REQUEST_URI"]) ? $_SERVER["REQUEST_URI"] : '';
// redirect the user to the new destination:
header('Location: http://www.1sucai.cn' . $url);
// Convert "special" chars -- cause we never now... ;-)
$url = htmlspecialchars($url);
// "fallback" link, if the browser is not supporting header redirects
print '<a href="http://www.1sucai.cn' . $url.'">Please click here</a>';
// stop the script execution here
exit;
}
// If the domain is www.1sucai.cn then go on with your PHP code
// of with your website...
// BTW: You need to replace jb51.net trough your own domain :-D
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有