+ -
当前位置:首页 → 问答吧 → apache二级域名

apache二级域名

时间:2010-10-08

来源:互联网

我的配置如下:
<VirtualHost *:80>
  ServerName www.test.com
  ServerAlias *.test.com 二级域名
  RewriteEngine On 
  RewriteCond %{HTTP_HOST} ^[a-z0-9\-]+\.test\.com$ 
  RewriteRule ^/?$ /%{HTTP_HOST}
  RewriteRule ^/([a-z0-9\-]+)\.test\.com/?$ /id=$1 [L,PT] 
  ProxyPass / http://www.test.com:8080/
  ProxyPassReverse / http://www.test.com:8080/
  </VirtualHost>
当访问user.text.com时,应该重写为user.text.com?id=user,这样是正确的,可是当用www.text.com时,会出现www.text.com?id=www,请问怎么把www过滤掉,让www.text.com访问主页,不转成二级域名

作者: yunlong167167   发布时间: 2010-10-08

我想实现这个功能,不知道nginx怎么实现

作者: bupabupa166   发布时间: 2010-10-09

热门下载

更多