编辑httpd.conf
在最后加上
  QUOTE: 
NameVirtualHost *
<VirtualHost *>
rewriteengine on 
rewritecond %{HTTP_HOST} [^.]+\.alibaba\.uni\.cc$ 
rewriterule ^(.+) %{HTTP_HOST}$1 [C] 
rewriterule ([^.]+)\.chinahtml\..com(.*) /$1$2 
    ServerAdmin webmaster@XXX.COM
    DocumentRoot /www
    ServerName chinahtml.com
    ErrorLog logs/chinahtml.com-error_log
    CustomLog logs/chinahtml.com-access_log common
</VirtualHost> 
将http://username.chinahtml.com对于username的主页请求转换为对http://chinahtml.com/username的请求 
---- 对于HTTP/1.1的请求包括一个Host: HTTP头,我们能用下面的规则集重写 http://username.chinahtml.com/anypath到/home/username/anypath。 
注: “rewritecond”表明是条件重写规则,当满足后面定义的条件后才会应用下面的重写规则,“rewritecond”有各种变量,请查阅相关文档。
其实是用到了APACHE的重写规则,大家可以看
http://chinahtml.com
我现在还开着的!
你可以打开里面的目录像这样打开测试一下
http://skyspy.chinahtml.com
http://discuz.chinahtml.com 

