Iis – Redirecting to a website based on url entered in IIS

iisredirect

So I run a small IIS server that hosts a website, for the sake of example let's call it xyz.com. I want to host abc.com on the same server. The directory to each website is something like:

c:\www\wwwroot\xyz\public_html\index.php
c:\www\wwwroot\abc\public_html\index.php

Where index.php is the main page of the website. How would I make it so that requests for xyz.com pulled up the homepage to xyz.com and the requests for abc.com pulled up abc.com? I would do this through a DNS zone file, but since it's two different TLD's on the same static IP I'm a bit confused about how to handle it.

Thanks,

Best Answer

You'll want to use host headers in IIS

This will allow you host multiple websites on port 80, the default port for http.

DNS is used to tell the internet, where those sites are supposed to exist (the public facing ip address of your webserver). Host headers in IIS, tell that traffic, where to find the files to serve up on the webserver, for that host (which gets passed along in the traffic). You will also want to set index.php as the default page in IIS (I can't remember if it's there by default or not).

Related Topic