我有一个可以正常工作的子域 sub1.primary.com。现在我需要设置 sub2.primary.com 并让它指向与 sub1.primary.com 相同的 Web 应用程序。我尝试将其作为新的 A 记录和新的 CName,但是当我尝试导航到 sub2.primary.com 并期望看到 sub1.primary.com 时,我看到 sub7.primary.com 上有一个完全不同的应用程序。
我尝试过 A 记录独奏、CName 独奏、两者一起尝试,以及带有和不带有指针记录的每个实例。我正在使用带有 IIS 6 的 Windows 2003 Server。我尝试在谷歌上搜索答案,但找不到任何信息。
这是我目前的设置。我已在 DNS 中为 sub2.primary.com 创建了一条主机 (A) 记录以及关联的指针记录。我已将 sub2.primary.com 添加到 sub1.primary.com 的主机标头。每当我导航到 sub2.primary.com 时,它都会显示 sub7.primary.com 而不是 sub1.primary.com。这很奇怪,因为如果它要默认为某些内容,我宁愿它默认为 www.primary。 com。
我不知道这是否重要,但 sub1.primary.com 使用 SSL,sub7.primary.com 以及其他 5 个 *.primary.com SSL 证书也是如此。
I have a sub-domain sub1.primary.com that works correctly. Now I need to setup sub2.primary.com and have it point to the same web application as sub1.primary.com. I tried it as a new A record and a new CName however when I try navigating to sub2.primary.com and expect to see sub1.primary.com I see a completely different application that sits on sub7.primary.com.
I have tried the A record solo, the CName solo, both together, and each instance with and without pointer records. I am using a Windows 2003 Server with IIS 6. I tried googling for an answer and couldn't find any information.
Here is my setup at the moment. I have created a Host (A) record in DNS for sub2.primary.com with an associated pointer record. I have added the sub2.primary.com to host headers of sub1.primary.com. Whenever I navigate to sub2.primary.com it displays sub7.primary.com instead of sub1.primary.com. Which is bizarre because if it were going to default to something I would rather it default to www.primary. com.
I don't know if it matters but the sub1.primary.com is under SSL and so is sub7.primary.com, along with 5 others on a *.primary.com SSL cert.
发布评论
评论(2)
每个子域都应该有一条指向同一 IP 的 A 记录。我听起来这就是您首先尝试的方法 - 如果这不起作用,我建议确保您的 Web 服务器的虚拟主机配置将 sub2.primary.com 发送到正确的位置。
Each subdomain should have an A record pointing to the same IP. I sounds like this is what you tried first -- if that didn't work, I'd suggest making sure that your web server's vhost configuration is sending sub2.primary.com to the right place.
当 IIS 在同一 IP 地址上托管多个网站时,它会使用传入请求 URL 来猜测将客户端发送到哪个虚拟站点。
换句话说:您需要配置主机标头以接受相应网站的两个名称。 Microsoft 在此处和此处 , 或 这里有更详细的解释。
When IIS hosts multiple websites on the same IP address, it uses the incoming request URLs to guess which virtual site to send the client to.
In other words: you need to configure your host headers to accept both names for the appropriate web site. Microsoft publishes some good how-to documentation here and here, or here is a more detailed explanation.