Home  >  Article  >  Backend Development  >  一个IP多个站点配置有关问题

一个IP多个站点配置有关问题

WBOY
WBOYOriginal
2016-06-13 12:50:33822browse

一个IP多个站点配置问题
 我想把两个域名解析到同一个209.221.156.243这个IP上,但是配置apache后 两个域名始终指向同一个站 
配置代码如下:
NameVirtualHost 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]


    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]


访问yy.com却访问到xx.com的程序!网上找了很多也没找到正解  望高手们帮看看


------解决方案--------------------
同一个端口怎么识别呢?
------解决方案--------------------
并没有发现写法上的问题,我也是这么写的
可能与 apache 的版本或其他设置有关
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn