apache泛域名配置+泛域名指向处理文件
来源:互联网 发布:北京现代软件学院 图片 编辑:程序博客网 时间:2024/04/30 10:00
http://wesoho.blog.51cto.com/715082/224158
# 泛域名解析
<VirtualHost 你的ip:80>
ServerName *.dswind.com
ServerAlias *.dswind.com
DocumentRoot "x:/Fanyuming"
<VirtualHost 你的ip:80>
ServerName *.dswind.com
ServerAlias *.dswind.com
DocumentRoot "x:/Fanyuming"
<Directory "x:/Fanyuming">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
x:/Fanyuming 放一个文件index.php 负责解释泛域名指向
<?php
$url_this=$_SERVER ['HTTP_HOST'];
$url_this=str_replace ("www.", "", $url_this);
$url_this=str_replace (".dswind.com", "", $url_this);
$url_this=str_replace ("'", "", $url_this);
$url_this=str_replace ("@", "", $url_this);
$url_this=str_replace ("=", "", $url_this);
$url_this=str_replace (";", "", $url_this);
$url_this=$_SERVER ['HTTP_HOST'];
$url_this=str_replace ("www.", "", $url_this);
$url_this=str_replace (".dswind.com", "", $url_this);
$url_this=str_replace ("'", "", $url_this);
$url_this=str_replace ("@", "", $url_this);
$url_this=str_replace ("=", "", $url_this);
$url_this=str_replace (";", "", $url_this);
//固定二级域名优先解析
if($url_this=='2008')
{
header("location:"."http://www.dswind.com/zhuanti/ds13/ ");
}
{
header("location:"."http://www.dswind.com/zhuanti/ds13/ ");
}
if($url_this=='2009')
{
header("location:"."http://www.dswind.com/aboutus/yantaohui/");
}
{
header("location:"."http://www.dswind.com/aboutus/yantaohui/");
}
if($url_this=='pku')
{
header("location:"."http://www.dswind.com/zhuanti/yantao/");
}
{
header("location:"."http://www.dswind.com/zhuanti/yantao/");
}
$dbh = mysql_connect('localhost','用户名','密码');
mysql_select_db('数据库名');
$query = "从数据库查询记录";
mysql_select_db('数据库名');
$query = "从数据库查询记录";
$res = mysql_query($query, $dbh);
$err = mysql_error();
if($err){
echo "发生错误,请通知站长";
exit;
}
$row = mysql_fetch_row($res);
if(empty($row[0]))
{
echo "<script>alert('该网址不存在');document.location='http://www.dswind.com'</script>";
exit;
}
else
{ header("location:"."http://www.dswind.com/member/index.php?uid=".$row[0]); }
?>
$err = mysql_error();
if($err){
echo "发生错误,请通知站长";
exit;
}
$row = mysql_fetch_row($res);
if(empty($row[0]))
{
echo "<script>alert('该网址不存在');document.location='http://www.dswind.com'</script>";
exit;
}
else
{ header("location:"."http://www.dswind.com/member/index.php?uid=".$row[0]); }
?>
<html>
<head>
</head>
<body>
正在进入<a href=http://dswind.com target=_blank>中华直销网</a>直销圈....
</body>
</html>
<head>
</head>
<body>
正在进入<a href=http://dswind.com target=_blank>中华直销网</a>直销圈....
</body>
</html>
本文出自 “扬帆技术博客” 博客,请务必保留此出处http://wesoho.blog.51cto.com/715082/224158
本文出自 51CTO.COM技术博客- apache泛域名配置+泛域名指向处理文件
- Apache+Tomcat 泛域名配置
- APACHE站点域名文件夹指向配置
- 配置域名指向
- 配置apache + tomcat 绑定泛域名
- 配置apache + tomcat 绑定泛域名
- 配置apache + tomcat 绑定泛域名
- Apache禁止域名恶意指向
- Apache域名泛解析
- Apache 泛域名 虚拟主机
- apache、resin泛域名、多域名设置
- Apache配置不同域名指向不同的目录
- 泛域名、子域名、URL转发与Mail指向 介绍
- 配置域名指向网站目录
- 配置Apache域名
- apache配置域名
- apache 域名配置方法
- Apache域名配置方法
- windows 下的静态、动态库
- String与StringBuilder关系
- VS2005中GridView自定义列TemplateField的数据绑定技巧!
- php加速文件eaccelerator.dll集合
- Ubuntu中观看PPStream
- apache泛域名配置+泛域名指向处理文件
- CentOS与REHL以及Redhat、Federal关系
- 电子商务对传统企业的革命
- wpf开发工具
- [经典]Linux内核中ioremap映射的透彻理解
- Learn Python in 10 Minutes
- 在 Visual Studio 2008 中开发 lua 的调试技巧
- iframe简单用法
- JDK6.0的新特性:轻量级Http Server