0

I host multiple domains on a GoDaddy shared hosting account. I would like to setup a website locally in IIS 7 that mimics the setup of my hosted account so that I can test and debug applications locally before deploying, as debugging after deploying, or discovering there are issues after deploying is frustrating.

I have created a folder WebRoot, at put my main application in that folder. I created a website in IIS 7 and pointed it at that folder. I setup bindings with a fake domain, and created a matching entry in my hosts file to make the fake domain point at my 127.0.0.1. I then created a folder www.otherdomain.com under webroot. I then created an application underneath my website, and pointed it at this folder. I can't find how I can add bindings to the web application to have it referenced as a different fake domain, rather than a subdirectory under my root domain.

What would be the proper way to setup IIS to best simulate the environment on the GoDaddy servers.

1 Answer 1

1

Bindings can only be done at site level. They cannot be done at application or folder level.

You have two options:

  1. Create a 2nd IIS site, bind it to your 2nd fake domain, and configure the application in there

  2. Add a 2nd binding to your existing website for your 2nd domain name. Then the site will respond on both domains. You can then use some server-side (or even javascript) code to redirect/reject queries that come in on the domain you don't want.

3
  • Your #2 option seems somewhat likely. If I have a website pointing at the folder /webRoot, and then I create an application inside that website pointing at /webRoot/www.domain1.com then I get some of the same behavior as godaddy. One big difference is in my configuration, the sub application doesn't get web.config values from the root application (website), but on godaddy, it does get those values. However, I'm sure it is not a virtual directory because it allows application level settings in the web.config.
    – NerdFury
    Jan 19, 2010 at 17:26
  • Also, www.domain1.com will take me to the /www.domain1.com folder on godaddy, but Action Links created with asp.net mvc append the folder name in the urls generated making them www.domain1.com/www.domain1.com/hom which is not desirable, but I may not have an option there, other than to write my own link generator.
    – NerdFury
    Jan 19, 2010 at 17:28
  • @NerdFury have you been able to solve the issue where ASP.Net MVC Html.ActionLink() appends the subfolder?
    – Alex
    Aug 5, 2010 at 3:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .