Setup asp.net mvc application as subdomain website

asp.net-mvciis-6subdomain

I'm trying to setup a local application on a subdomain on our company server. There is already an installation of sharepoint running on http://companyweb/, but I would like my application to run on http://orders.companyweb/.

I tried creating a new website, leaving the IP address the same as it is for http://companyweb, and just changing the host header value to orders.companyweb. However, no matter where I try to access the site from (different computers around the network, including the server itself), I keep getting 404 errors.

I then tried setting up a simple index.html and serving that up as the highest priority; however, I still got 404 errors. This makes me think that I have actually setup the site itself wrong.

What should I change to be able to access this application correctly on all the local computers?

Best Answer

I found a solution for this problem that works (for me, anyway). The solution is based on this Microsoft support ticket. The steps I used are as follows:

  1. Open the DNS snap-in. To do this, click Start, point to Administrative Tools, and then click DNS.
  2. Expand the "Forward Lookup Zones" folder.
  3. Expand the folder for the local network (it contains the hostnames of all the computers on the network, with their IP address) - in my case it was companyname.local.
  4. Add an "Alias (CNAME)" entry (by right clicking on a blank spot, or Actions -> New Alias (CNAME) ).
  5. Under "Alias name", type in the name that the new website will have (in my case, it was orders)
  6. Under "Fully qualified domain name", type in the name of the server hosting the website (in my case, server.companyname.local).
  7. Under the IIS Management snap-in, open the properties for the new website.
  8. On the "Web Site" tab, click the "Advanced" button next to the "IP Address" box.
  9. Click on the default identity for the web site (most likely "Default" IP Address, port 80), then click "Edit"
  10. For the "Host Header value", type in the name of your new website (in my case, it was orders)
  11. Save and close all the open dialogs.

This method worked for me; I hope that it might be of use to someone else as well. Sorry for such a long list, but it takes a bit to get working.

Related Topic