loading site from subdirectory

Discussion in 'Visual Studio' started by philos, Jan 5, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. hello,

    i am trying to load a newly uploadedsite from a subdirectory off of the root directory on my discountasp account, but am unsure of how to redirect. i would like to have the site load www.mysite.com/index.aspx on the root directory but then launch the real web application from www.mysite.com/subdir/default.aspx where the main web site code filesare located.

    does anyone know an easy redirect method for this scenario?

    thanks!
     
  2. You can have something like in your Page load event handler of index.aspx

    if (Request.Url.ToString().Contains('otherdomain1.com'))
    {
    Response.Redirect('/subdir1');
    }
    else if (Request.Url.ToString().Contains('otherdomain2.com'))
    {
    Response.Redirect('/subdir2');
    }
    and so on....

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. For a simple redirect page, drop a file named "index.html" into your root directory (the location that the user would hit first...www.mysite.com/index.html) and make sure that it is marked in the DASP user console as the default document. Place this code in your <head></head> element:
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page