Redirecting users to different site

Discussion in 'ASP General' started by Dave, Jun 30, 2005.

  1. Dave

    Dave Guest

    I am moving a web to a new address. The old address will be shut down in
    several weeks.

    Is there a way to automatically redirect users who come to the old site in
    these last few weeks to the appropriate page on the new site?
    Dave, Jun 30, 2005
    #1
    1. Advertising

  2. Dave

    Bullschmidt Guest

    Here's a sample page I've used to redirect the user:

    <html>
    <head>
    <script type="text/javascript"> <!--
    // Go to pg.
    window.location.href = "http://www.mysite.com/mypage.htm";
    //-->
    </script>
    </head>
    </html>

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Developer
    http://www.Bullschmidt.com
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Developersdex http://www.developersdex.com ***
    Bullschmidt, Jun 30, 2005
    #2
    1. Advertising

  3. Dave [D], on Wednesday, June 29, 2005 at 21:36 (-0700) contributed
    this to our collective wisdom:

    D> Is there a way to automatically redirect users who come to the old site in
    D> these last few weeks to the appropriate page on the new site?

    Response.Redirect "http://yourpage.com"

    --

    How do you protect mail on web? I use http://www.2pu.net

    [No free man shall ever be barred the use of arms - Jefferson]
    Ing. Branislav Gerzo, Jun 30, 2005
    #3
  4. Dave

    Adrienne Guest

    Gazing into my crystal ball I observed Bullschmidt <-
    nospam> writing in news::

    > Here's a sample page I've used to redirect the user:
    >
    ><html>
    ><head>
    ><script type="text/javascript"> <!--
    > // Go to pg.
    > window.location.href = "http://www.mysite.com/mypage.htm";
    > //-->
    ></script>
    ></head>
    ></html>
    >
    > Best regards,
    > J. Paul Schmidt, Freelance ASP Web Developer
    > http://www.Bullschmidt.com
    > ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
    >


    Which will not work for the most important visitor, Google. Better:
    <%
    dim pagename
    pagename = right(request.servervariables("script_name"),instrrev
    (pagename,"/")+1) 'you might have to play with this to get the exact page
    name.

    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location", "http://www.example.com/" & pagename
    %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
    <head>
    <title><%=pagename%> Moved</title>
    </head>
    <body>
    <h1><%=pagename%> Moved</h1>
    <p>The page you have requested has moved to <a href="<%=pagename%>"><%
    =pagename%>. Please change your bookmarks. If your browser has not taken
    you to the page automatically, please go to <a href="<%=pagename%>"><%
    =pagename%></a>.</p>
    </body>
    </html>

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, Jul 1, 2005
    #4
    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. Marlon
    Replies:
    3
    Views:
    681
    JerryK
    Dec 9, 2004
  2. Nita Raju
    Replies:
    1
    Views:
    285
    Chris Hyde
    Dec 15, 2004
  3. =?Utf-8?B?aGVjc2FuMDc=?=

    Redirecting users

    =?Utf-8?B?aGVjc2FuMDc=?=, Feb 10, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    326
    Karl Seguin
    Feb 10, 2005
  4. Replies:
    9
    Views:
    616
    =?Utf-8?B?RWx0b24gVw==?=
    Mar 8, 2006
  5. Russ
    Replies:
    5
    Views:
    118
    Martijn Lievaart
    Aug 22, 2007
Loading...

Share This Page