APACHE绑定多域名不用重新启动的原理和方法

| |
时间: 不指定 2008/03/04 10:21 , 作者: 邢磊
编辑httpd.conf
在最后加上

引用
NameVirtualHost *


rewriteengine on
rewritecond %{HTTP_HOST} [^.]+\.alibaba\.uni\.cc$
rewriterule ^(.+) %{HTTP_HOST}$1 [C]
rewriterule ([^.]+)\.alibaba\.uni\.cc(.*) /$1$2
    ServerAdmin webmaster@XXX.COM
    DocumentRoot /www
    ServerName alibaba.uni.cc
    ErrorLog logs/alibaba.uni.cc-error_log
    CustomLog logs/alibaba.uni.cc-access_log common



将http://username.xxx.com对于username的主页请求转换为对http://xxx.com/username的请求
---- 对于HTTP/1.1的请求包括一个Host: HTTP头,我们能用下面的规则集重写 http://username.xxx.com/anypath到/home/username/anypath。
注: “rewritecond”表明是条件重写规则,当满足后面定义的条件后才会应用下面的重写规则,“rewritecond”有各种变量,请查阅相关文档。

类别:ASP:PHP:C#.NET | Tags: , | 0 条评论, 422 次阅读
网友评论(0):
发表评论
表情
emotemotemotemot
emotemotemotemot
emotemotemotemot
emotemotemotemot
emotemotemotemot
emotemotemotemot
emotemotemotemot
emotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]
               

验证码 不区分大小写