subdomain issues - page redirection

Discussion in 'ASP.NET / ASP.NET Core' started by inzosoftwar, Feb 26, 2004.

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

    I have the following issue and support suggested that I post it here. I am trying to redirect a subdomain to a subdirectory of my web site using the information provided in article Q10102. I have put the following code in place:

    <%
    If InStr( Ucase(Request.ServerVariables("SERVER_NAME")), Ucase("http://backtrackhome.inzosoftware.com") ) > 0 Then
    Response.Redirect("http://www.inzosoftware.com/backtrackhome/index.aspx")
    End if
    %>

    This does not function when I go to http://backtrackhome.inzosoftware.com - it merely stays on the default web page.

    From what I can tell, there is nothing wrong with the code - but I'm not sure.

    Anyone got any ideas.

    On that same note, can you use a redirection in the same manner to point an entire URL (say www.backtrackhome.com) to the subdirectory?

    thanks in advance.

    michael
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Code looks good to me. Do you get any error message?

    For debugging I would add this

    <%
    If InStr( Ucase(Request.ServerVariables("SERVER_NAME")), Ucase("http://backtrackhome.inzosoftware.com") ) > 0 Then
    Response.Redirect("http://www.inzosoftware.com/backtrackhome/index.aspx")

    else
    response.write "Failed"
    End if
    %>


    What is the URL to the page?

    You'll have to make sure you save it as the ONLY default document in your root.

    quote:Originally posted by inzosoftwar

    Hello all,

    I have the following issue and support suggested that I post it here. I am trying to redirect a subdomain to a subdirectory of my web site using the information provided in article Q10102. I have put the following code in place:

    <%
    If InStr( Ucase(Request.ServerVariables("SERVER_NAME")), Ucase("http://backtrackhome.inzosoftware.com") ) > 0 Then
    Response.Redirect("http://www.inzosoftware.com/backtrackhome/index.aspx")
    End if
    %>

    This does not function when I go to http://backtrackhome.inzosoftware.com - it merely stays on the default web page.

    From what I can tell, there is nothing wrong with the code - but I'm not sure.

    Anyone got any ideas.

    On that same note, can you use a redirection in the same manner to point an entire URL (say www.backtrackhome.com) to the subdirectory?

    thanks in advance.

    michael
    </blockquote id="quote"></font id="quote">
     
  3. Request.ServerVariables("SERVER_NAME") does not contain the 'http://' bit - only the 'www.inzosoftware.com' bit.
     
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