locked
Host a second site (*.com) in the same Web Application? RRS feed

  • Question

  • User-2053865247 posted

    Hello,

    I have a single ASP.NET web application.  Can I create a new folder in my ASP.NET web application, called "MyNewSite", and somehow configure IIS to point a domain to it?  Let's assume my current site is "mysite.com", and so I want "mynewsite.com" to point to the new "MyNewSite" folder.  I don't want to create a second web application.

    Thanks!

    Wednesday, January 2, 2013 11:18 AM

Answers

  • User-718146471 posted

    Why do you want to host a domain inside your existing web application? What might be a gotcha is if this web site has its own web.config, you could encounter errors like machinetoapplication level. If you are doing a simple html site for this second site, you could do the domain inside your web folder. If it is an actual application, you will want to configure it separately with its own folder, app pool, etc.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 2, 2013 11:22 AM
  • User1759999623 posted

    With the new domain, you will need to create a second web application.  IIS will need to handle this domain independent of your other domain.

    What exactly are you trying to accomplish?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 2, 2013 11:22 AM
  • User1196771204 posted

    hi matt,

    What you actually want here is certainly achieveable. Obviously, you can always create a web application as a new folder on a domain and have another domain points to this folder. This is certainly fine. However, you need to make sure you convert this folder as a virtual folder, or otherwise, your folder will not work fine and hence, the domain that points to this folder will not work either

    I am not particularly sure on how you achieve this in Windows Azure, but with a shared host, this is certainly something that is easy to do.

    Please mark this response as an "answer" if it helps you. Thanks heaps! 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 3, 2013 1:38 AM

All replies

  • User-718146471 posted

    Why do you want to host a domain inside your existing web application? What might be a gotcha is if this web site has its own web.config, you could encounter errors like machinetoapplication level. If you are doing a simple html site for this second site, you could do the domain inside your web folder. If it is an actual application, you will want to configure it separately with its own folder, app pool, etc.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 2, 2013 11:22 AM
  • User1759999623 posted

    With the new domain, you will need to create a second web application.  IIS will need to handle this domain independent of your other domain.

    What exactly are you trying to accomplish?

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 2, 2013 11:22 AM
  • User-2053865247 posted

    Hey guys, thanks for the replies.  I'm actually hosting it on Azure.  I think I found how to do it here: http://msdn.microsoft.com/en-us/wazplatformtrainingcourse_advancedwebandworkerroles_topic2

    Wednesday, January 2, 2013 11:28 AM
  • User1196771204 posted

    hi matt,

    What you actually want here is certainly achieveable. Obviously, you can always create a web application as a new folder on a domain and have another domain points to this folder. This is certainly fine. However, you need to make sure you convert this folder as a virtual folder, or otherwise, your folder will not work fine and hence, the domain that points to this folder will not work either

    I am not particularly sure on how you achieve this in Windows Azure, but with a shared host, this is certainly something that is easy to do.

    Please mark this response as an "answer" if it helps you. Thanks heaps! 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 3, 2013 1:38 AM