Subdomain redirect

Discussion in 'General troubleshooting' started by Pickels, Jan 28, 2010.

  1. Hello,

    I think I am a little 'confused' about how the subdomains work. So I got an application that can only run on the root of a website due to routing. So normally I would create a subdomain and put the website there(application.mydomain.com). Now with the redirect you still get the folder of the subdomain in the url(application.mydomain.com/application). This messes up my routing of the application (mvc) and it wont find my views any more.

    As you can see here:
    http://sense.friendly-stranger.com/

    Am I missing something or is this the expected behavior? Found it weird it was so cumbersome to setup subdomains while the rest of DASP hosting is mostly very user friendly and easy to use.

    I did some forum searching and if url rewriting is the answer I wonder if anybody has an example of that?

    Thanks in advance,

    Pickels
     
  2. Did I ask something silly?
     
  3. You didnt ask anything silly. Its a great question. Its a tough one as well so while I dont think I can solve it for you cut and dry, I may have points that will help.

    - First to clarify the subdomain issue
    The subdomain addon will point any and all subdomain requests to the root of your webspace automatically. This is not a redirection. The subdomain request resolves to your root no differently than just the domain name.

    This is indeed causing an issue with routing because the current URL (the subdomain version) is not what your application is expecting.

    I am not sure why you need to use a subdomain, if you have to have the application in a subdirectory or in the root, etc. So I will make a general comments based upon what I stated above.

    The simplest fix would be to configure your application to use the subdomain address.

    Another option would be to perform redirection based upon the requested URL prior to starting your MVC application. Meaning have a standard asp.net application responsible solely for redirection and URL rewriting that then points to the MVC application.


    [​IMG]


    [​IMG]
     
  4. Thanks for the answer Chuck. Going to do a few tests as soon as I have more time.
     

Share This Page