I want to know if itâ€™s possible to host two websites on the same server using the same port (80) and IP address. I am limited to using Microsoft IIS 7.0 not apache, but I can run PHP on it. (One of the sites is Joomla based)
If I register two domain names to, example1.com and example2.com, to IP address xx.xxx.xxx.xxx is there a script I could run or an IIS setting I could change so that users are redirected to a different folder or index page based on which domain name they use? Also if this is done with a PHP script or something similar would search engines index both pages correctly?
I know similar results can be achieved with Apache by using Virtual hosts in the httpd.conf file, but unfortunately I donâ€™t know if this is possible with IIS.
Thanks for the help
It is possible with IIS and has been since IIS 5.0. You need to do some research on Subwebs and virtual folders in IIS as there are many many different ways to implement this and no one method is going to be right for everyone. Basically there are Identities for each website under IIS and depending on your needs you may want a url redirect like http://www.somedomain.com/subweb1.htm?=somenewsite.aspx
and http://www.somedomain.com/subweb1.htm?= ... wsite.aspx
or you may need to assign headers for a site (too many approaches to discuss here) or you may need http://www.domain1.com
. There are also commercial applications and opensource applications that allow you to redirect onto their domains as either a subweb or a top level domain.