IIS7-如何将相同的物理路径用于不同的域? [英] IIS7 - How do I use the same physical path for different domains?
问题描述
我有两个域: principal.comcopy.com
当有人键入copy.com时,我希望用户看到principal.com的内容,但没有将他重定向到该域.
When someone type copy.com I want the user to see principal.com contents but whithout redirecting him to that domain.
此外,如果我创建一个子域(例如 sub.copy.com),它将显示principal.com的内容.同样,无需将用户重定向到该域.
Also if I create a subdomain such as sub.copy.com it will show the content from principal.com. Again, without redirect the user to that domain.
我尝试将copy.com的DNS配置为指向principal.com的相同IP地址,但是我不知道如何在IIS7中配置此域以使用与principal.com相同的物理路径,或者如果我需要执行其他任务 ...
I tried configurating the DNS of copy.com to point to the same IP address of principal.com But I don't know how to configure this domain in IIS7 for use the same physical path as principal.com or If I need to do some other task...
我已经用apache和vhost文件做到了这一点.将多个域指向相同的DocumentRoot并将DNS配置为使用相同的IP地址...但是使用IIS7,我不知道该怎么做...
I have done this with apache and the vhost files. Pointing multiple domains to the same DocumentRoot and configurating the DNS to use the same IP ADDRESS... But with IIS7 I don't know how to do it...
我如何实现自己想要的?
How Can I achieve what I want?
推荐答案
如果将多个主机头添加到网站(每个域一个),则IIS应该能够为两个请求提供相同的内容.
If you add multiple host headers to the web site (one for each domain), IIS should be able to serve up the same content for both requests.
为此,请单击IIS中的站点,在右侧面板中(操作"),单击绑定...",然后您应该能够输入不同的主机名.
To do this, click on the site in IIS, in the right hand panel ("Actions"), click on "Bindings..." and there you should be able to enter the different host names.
这篇关于IIS7-如何将相同的物理路径用于不同的域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!