Correct way to code a redirect in Index.asp

Discussion in 'ASP.NET / ASP.NET Core' started by DMArtist, Jan 23, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Not having much luck with the code in index.asp to rediect my two domains www.artistfamily.com and www.musicianfamily.com to begin execution of the proper program application. Need some help.

    Here is what I got using Q10102 as a reference:

    For ArtistFamily.com:

    If InStr(UCase(Request.ServerVariables
    ("ns1.discountasp.net")), UCase
    ("FriendsReunionUI.ArtistFamily.com")) > 0 Then
    Response.Redirect("FriendsReunionUI/HomePage.aspx")
    End If

    For MusicianFamily.com:

    If InStr(UCase(Request.ServerVariables("ns1.discountasp.net")), UCase("MFamily.MusicianFamily.com")) > 0 Then
    Response.Redirect("MFamily/HomePage.aspx")
    End If

    Do I have the correct format:

    "SERVER_NAME" is "(ns1 or ns2 or ns3).discountasp.net"

    "subdomain1.YourHostedDomainName.com" is
    "FriendsReunionUI.ArtistFamily.com"
    or
    "MFamily.MusicianFamily.com"

    Can AnyonePlease Advise.

    Dale Missler
     
  2. Just by looking at your code, I have no idea what you're trying to do.


    But my guess is, this line...


    Request.ServerVariables("ns1.discountasp.net")


    Should look like this



    Request.ServerVariables("SERVER_NAME")


    Joel Thoms
    DiscountASP.NET
    http://www.DiscountASP.NET
     
  3. Have something like this:

    if (Request.Url.ToString().Contains('ArtistFamily'))
    {
    Response.Redirect('/FriendsReunionUI');
    }

    else if (Request.Url.ToString().Contains('MusicianFamily'))
    {
    Response.Redirect('/MFamily');
    }

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
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