IIS7 - How do I use the same physical path for dif

2019-08-21 10:13发布

问题:

I have two domains: principal.com copy.com

When someone type copy.com I want the user to see principal.com contents but whithout redirecting him to that domain.

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.

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...

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?

回答1:

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.

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.



标签: iis-7 path dns