Courses Academic Links Functional Stuff and Widgets Cool Stuff

Dual-Homing Websites using IIS at Penn State

So, you want http://www.yourwebsite.psu.edu and http://yourwebsite.psu.edu to send users to the same website location, right? You also want users to be redirected to the “www” version of your site if they happen to type in the address of your website (or any page within the site) without the “www” on the front. Well, if that's the case, then these instructions are for you! Note, these instructions assume TNS run DNS for your subdomain and your web server running on Microsoft IIS 6.0 (Windows 2003 Web Server Edition, or similar).

Creating and Modifying DNS run by TNS

The first thing is that both DNS names need to resolve to the IP address of your web server. To accomplish this, you will need configure DNS properly. If you run your own DNS, then you’re on your own. Sorry. L However, if you are using TNS’s DNS service, then the following instructions should help. You need to submit DNS change requests through the following webpage: http://tns.its.psu.edu/services/IB/dns.html

DNS Step 1

Submit the request for your subdomain name via the following form: https://www4.tns.its.psu.edu/scripts/IBSvcs/DNSZoneRequestForm.cfm

This will set up “yourdomain” as a subdomain (Zone) under the psu.edu domain.

DNS Step 2

You need to submit the IP address of your server next. If you’re running one server, this is pretty easy to accomplish. Submit two entries for your subdomain in the following URL: http://www4.tns.its.psu.edu/scripts/ibsvcs/dnsmenu.asp

Your completed form should look something like the completed form below.

Note that the IP address for the subdomain is added as an “A” record with the IP address of your web server. The “www” address is added as a CNAME, which points to the named address of the subdomain. Notice that the “subdomain” record isn’t actually properly implemented in the TNS form. That’s ok – just make sure that you give Jim Swenson (The TNS DNS guy) sufficient information in the “additional comments” field to make sure that he understands what you’re trying to do. Otherwise, expect a phone call.

IIS 6.0 Configuration Instructions

IIS Step 1

Now you need to set up Microsoft Internet Information Services (IIS) to handle the two website names. Basically, you’re going to have two "websites" inside IIS, each one responds to an individual website address.

To make a website respond to only a certain URL, do the following:

  • Open IIS
  • Right click on the "web site"
  • Go to Properties
  • Choose the Website tab
  • Choose the Advanced Button
  • Remove any profiles listed in the “Multiple Identities for this website” box
  • Add a new profile for the site. Make sure that the TCP port is 80 and the “Host Header Value” is the website URL for the website in question – such as www.yoursite.psu.edu or yoursite.psu.edu
  • Click OK to set up this identity
  • Click OK to save all of the identities of this website
  • Click OK to complete the configuration of the “site”

Repeat these steps for the other “site”

IIS Step 2

  • Right click on the site that doesn’t have the www in front of it (the non-www Redirect in this example)
  • Choose Properties
  • Choose “Home Directory” Tab.
  • Select “a redirection to URL
  • In the “redirect to” box – type in the full URL of the other website (http://www.yoursite.psu.edu in this example)

You’re Done!

Now you can load your content into the “www” version of your site, and leave the other “site” as a simple forwarder. If a user types http://yoursite.psu.edu into their web browser, they will be redirected to http://www.yoursite.psu.edu automatically. If you have a page in your site called page1.html and a user types http://yoursite.psu.edu/page1.html - they will be redirected to the same place on the “www” version of the site.