• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

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

php 搞代码 4年前 (2022-01-24) 13次浏览 已收录 0个评论

一个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 6本文来源gao@dai!ma.com搞$代^码!网7

搞gaodaima代码

^(.*)$ 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 的版本或其他设置有关


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:一个IP多个站点配置有关问题
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址