Redirecting users to different site

D

Dave

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?
 
I

Ing. Branislav Gerzo

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"
 
A

Adrienne

Gazing into my crystal ball I observed Bullschmidt <[email protected]
nospam> writing in
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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top