如何在 IIS 7 上设置子域 [英] How to set up subdomains on IIS 7
问题描述
我有一个位于 IIS 7 服务器上的网站:WWW.example.COM
I have a website sitting on an IIS 7 server: WWW.example.COM
我想创建几个子域,看起来像SUBDOMAIN1.example.COM
I would like to create several sub domains that looks like SUBDOMAIN1.example.COM
我创建了一个 IIS 网站并将绑定设置为http,端口 80,我的服务器的 IP 地址,以及 SUBDOMAIN1.example.COM 和 example.COM
I created an IIS website and I set the bindings to be http, port 80, the ip address of my server, and SUBDOMAIN1.example.COM and the physical path to a folder under example.COM
我重新启动了我的网站并点击浏览,浏览器打开了地址:http://SUBDOMAIN1.example.COM
I restarted my website and clicked on browse, the browser than opened with the address: http://SUBDOMAIN1.example.COM
但是网站没有显示.
我需要对 DNS 做些什么吗?
Do I have to do something with the DNS?
推荐答案
这个让我发疯...基本上你需要两件事:
This one drove me crazy... basically you need two things:
1) 确保您的 DNS 设置为指向您的子域.这意味着要确保您的子域在 DNS 中有一个 A 记录并指向相同的 IP.
1) Make sure your DNS is setup to point to your subdomain. This means to make sure you have an A Record in the DNS for your subdomain and point to the same IP.
2) 您必须在 IIS 7 中添加一个名为 subdomain.example.com 的附加网站
2) You must add an additional website in IIS 7 named subdomain.example.com
- 网站 > 添加网站
- 网站名称:subdomain.example.com
- 物理路径:选择子域目录
- 绑定:与example.com相同的ip
- 主机名:subdomain.example.com
这篇关于如何在 IIS 7 上设置子域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!