一个IP多个站点配置问题
我想把两个域名解析到同一个209.221.156.243这个IP上,但是配置apache后 两个域名始终指向同一个站
配置代码如下:
NameVirtualHost 209.221.156.243:80
<VirtualHost 209.221.156.243:80>
ServerName xx.com
DocumentRoot d:/aa
ErrorDocument 404 /404.html
ErrorLog "|bin/rotatelogs.exe -l d:/aa/logs/errorlog.%Y-%m-%d-%H_%M_%S.log 86400"
CustomLog "|bin/rotatelogs.exe -l d:/aa/logs/access%Y-%m-%d.log 86400" combined
RewriteEngine on
RewriteCond %{HTTP_HOST} ^xx.com [NC]
RewriteRule ^(.*)$ http://www.xx.com$1 [L,R=301]
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
</VirtualHost>
<VirtualHost 209.221.156.243:80>
ServerName yy.com
DocumentRoot d:/bb
ErrorDocument 404 /404.html
ErrorLog "|bin/rotatelogs.exe -l d:/bb/logs/errorlog.%Y-%m-%d-%H_%M_%S.log 86400"
CustomLog "|bin/rotatelogs.exe -l d:/bb/logs/access%Y-%m-%d.log 86400" combined
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yy.com [NC]
RewriteRule ^(.*)$ http://www.yy.com$1 [L,R=301]
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
</VirtualHost>
访问yy.com却访问到xx.com的程序!网上找了很多也没找到正解 望高手们帮看看
------解决方案--------------------同一个端口怎么识别呢?
------解决方案--------------------并没有发现写法上的问题,我也是这么写的
可能与 apache 的版本或其他设置有关