redirect to new server?

Discussion in 'ASP General' started by js, Sep 27, 2004.

  1. js

    js Guest

    Hi, I have several sites in my old server, I want to retire the old server.
    During the DNS change, it will take about 2 days. how can I redirect the old
    traffic to the new server, and make sure header information (i.e. the URL)
    will get redirected as well so that the new server will know which
    application to response to the requests.

    Thanks in advance.
    js, Sep 27, 2004
    #1
    1. Advertising

  2. js

    Evertjan. Guest

    js wrote on 27 sep 2004 in microsoft.public.inetserver.asp.general:

    > Hi, I have several sites in my old server, I want to retire the old
    > server. During the DNS change, it will take about 2 days. how can I
    > redirect the old traffic to the new server, and make sure header
    > information (i.e. the URL) will get redirected as well so that the new
    > server will know which application to response to the requests.
    >


    Use a customized 404.asp page

    select the error string, replace the domain and do a redirect.

    Then delete or rename all other root files and all folders

    qstr = lcase(Request.ServerVariables("QUERY_STRING"))

    will give you in qstr something like:

    404;http://myOldD.org:80/myFolder/myFile.asp?a=12345

    so write this vbscript in the 404.asp:

    <%
    qstr = lcase(Request.ServerVariables("QUERY_STRING"))
    qstr = replace(qstr,"404;http://myOldD.org:80","http://NewDomain.org")
    response.redirect qstr
    %>

    not tested

    Form posting and old cookies fail of course,
    as will capitals in the querystring
    in this simple example.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Sep 27, 2004
    #2
    1. Advertising

  3. js

    js Guest

    Thanks Evertjan.

    The customized 404.asp is not related to the IIS's 404 page, Right?



    Since domain names are still the same (during DNS change, only IPs got
    change). I can't do a replacement. Can I do this: Put the IPs mapping in a
    host file. And redirect like this:

    <%
    qstr = lcase(Request.ServerVariables("QUERY_STRING"))
    response.redirect qstr
    %>




    customized 404.asp
    > <%
    > qstr = lcase(Request.ServerVariables("QUERY_STRING"))
    > qstr = replace(qstr,"404;http://myOldD.org:80","http://NewDomain.org")
    > response.redirect qstr
    > %>
    >
    js, Sep 27, 2004
    #3
  4. js

    Evertjan. Guest

    js wrote on 27 sep 2004 in microsoft.public.inetserver.asp.general:

    > The customized 404.asp is not related to the IIS's 404 page, Right?


    I think it is an IIS setting to lok for the custom page.

    > Since domain names are still the same (during DNS change, only IPs got
    > change). I can't do a replacement.


    Yes, I see.

    But than you can use the IP:

    qstr = replace(qstr,"404;http://myOldD.org:80","http://123.456.654.321")


    > Can I do this: Put the IPs mapping
    > in a host file. And redirect like this:
    >
    > <%
    > qstr = lcase(Request.ServerVariables("QUERY_STRING"))
    > response.redirect qstr
    > %>


    Only in the 404.asp does the "QUERY_STRING" contain the url!

    And even then:

    Put the code in for every individual file ??

    Good luck ;-}


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Sep 27, 2004
    #4
  5. js

    js Guest

    Thanks Evertjan.
    "Evertjan." wrote :
    > js wrote on 27 sep 2004 in microsoft.public.inetserver.asp.general:
    >
    > > The customized 404.asp is not related to the IIS's 404 page, Right?

    >
    > I think it is an IIS setting to lok for the custom page.


    How to force to hit 404 page?
    js, Sep 27, 2004
    #5
  6. js

    Evertjan. Guest

    js wrote on 27 sep 2004 in microsoft.public.inetserver.asp.general:

    > Thanks Evertjan.
    > "Evertjan." wrote :
    >> js wrote on 27 sep 2004 in microsoft.public.inetserver.asp.general:
    >>
    >> > The customized 404.asp is not related to the IIS's 404 page, Right?

    >>
    >> I think it is an IIS setting to lok for the custom page.

    >
    > How to force to hit 404 page?


    Any nonexisting page will be redirected to the 404 page.

    So as I said:

    rename [or delete] your root folders and all the root files but the
    404.asp, so no user can find an existing file.

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Sep 27, 2004
    #6
  7. js

    js Guest

    Thanks Evertjan.
    js, Sep 28, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Turley
    Replies:
    1
    Views:
    4,527
    Joey Powell
    Jan 6, 2004
  2. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,233
    Srowe1975
    Oct 15, 2008
  3. Sal
    Replies:
    1
    Views:
    403
  4. Ron Howard
    Replies:
    2
    Views:
    514
    Ron Howard
    Aug 11, 2004
  5. Replies:
    2
    Views:
    449
    Thomas 'PointedEars' Lahn
    Mar 11, 2008
Loading...

Share This Page