3

I have a domain where I have created several subdomains. I manage to alter the DNS records, so a given subdomain redirects to a different server. For example?

app.domain.com -> 123.45.66.11 

Now, my app is an ASP.NET MVC app responding to the following URL 123.45.66.11/app. How do I configure IIS, that the url

http://app.domain.com -> 123.45.66.11/app

points to my virtual directory app instead of the root.

3

What version of IIS are you running? You'll need to setup host headers to accomplish what you want to do.

IIS 6 http://microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/883a9544-3f70-4d46-a6df-bbadbd1fe7de.mspx?mfr=true

IIS 7 http://technet.microsoft.com/en-us/library/cc753195%28WS.10%29.aspx

  • @Micheal I am running IIS7 and I could not find the settings there. Thanks for the links – gyurisc Jun 6 '11 at 7:30
  • The IIS 7 link is not working for me. – gyurisc Jun 6 '11 at 7:32
  • I had to add a new site in IIS7 with a new host header and then point it to my web app. It is now working perfectly. – gyurisc Jun 8 '11 at 6:58
  • One link is spam, and another is broken. Another reason primarily link based answers are bad. – Joshua Drake Aug 25 '17 at 13:02
0

In the IIS Manager right click on Sites, and choose Add Web Site... In the opened window:

  1. Choose a name for your application and write it under Site name
  2. Push the Select... button near the Application pool and choose ASP.NET v4.0
  3. Under Physical path browse for the web-app location (usually under c:\inetpub\wwwroot...). Remark: Usually when I push Test Settings... it doesn't work. But still the hole process works. So just be patient and keep tracking.
  4. In the Binding all you need to insert is your subdomain name (app.domain.com) under Host name.
  5. Push OK

That's it! Enjoy your new subdomain address :-)

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.