How to Host Multiple Domains / Web Sites on one IIS6 Server

I currently have an IIS6 server that hosts one web site/domain. I am developing another web site (completely separate) that I want to host on this same server. Both domains were purchased from GoDaddy.

I believe I will need a server-side ISAPI rewrite filter to internally route the incoming requests based on the domain name. I plan to use Ionic's ISAPI Rewrite Filter to do this because it is free. I know how to install the ISAPI filter and apply it to a web site in IIS, but I have no clue how I am going to route the incoming requests correctly (based on the domain).

Also, I don't know if it is wise to setup multiple "Web Sites" or "Virtual Directories". I am thinking that this will depend on how the configured.

How should I go about getting this accomplished?


Solution 1:

You don't want rewrite rules at all, you do want to setup a new website configuration. IIS 6 can differentiate between websites via either using a new IP address (so the server has multiple IP addresses), or by using a host header to link a domain to a website configuration.

Try starting here: Hosting Multiple Web Sites on a Single Server (IIS 6.0) and Using Host Headers to host multiple websites on IIS 6.0

Solution 2:

I see no problem here. IIS 6 can host hundreds of websites - even for on the same IP address (except for https you'll need a dedicated IP address) - distinguishing them by the host header (domain name).

Read this Microsoft Support article: HOW TO: Use Host Header Names to Configure Multiple Web Sites in Internet Information Services 6.0:

Microsoft Internet Information Services (IIS) permits you to map multiple Web sites with the same port number to a single IP address by using a feature called Host Header Names. By assigning a unique host header name to each Web site, this feature permits you to map more than one Web site to an IP address.

I think Ionic's ISAPIRewrite filter is applied to web sites, each web having its own definition file. I use a similar filter (ISAPI Rewrite) on my IIS servers, with many web sites on the server without any problem.

Solution 3:

All you're looking for is Host Headers. As long as the host headers are different, multiple sites can share the same port. Go to the properties of the site, and under the "Advanced" button next to the IP Address binding dropdown, you can edit the port and host header(s) for the site.

No more drama than that. ;)

Solution 4:

Splattne and others are correct - IIS6 alone can host multiple web sites.

A rewriter like IIRF is useful for rewriting requests as they come in. For example, you could rewrite a request on the server side, which arrives for host1.domain.com, to be served by the vdir "normally" associated to host2.

URL Rewriting is not necessary in order to host multiple websites.