473,498 Members | 1,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Redirecting users to different site

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?
Jul 22 '05 #1
3 1547
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 ***
Jul 22 '05 #2
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]

Jul 22 '05 #3
Gazing into my crystal ball I observed Bullschmidt <pa**@bullschmidt.com-
nospam> writing in news:uV*************@TK2MSFTNGP09.phx.gbl:
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"),instr rev
(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
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
1799
by: For Example: John Smith | last post by:
Hi, I thought this was simple to do but I have not had any luck. I would like to have two versions of my web site which are optimised for different browsers. One version for IE and one version...
3
1494
by: Marlon | last post by:
I have a site that is now SSL secured. User not still using the http:// to get to the site. How can I redirect the user the the visited page using https:// ?
1
1148
by: hecsan07 | last post by:
I am a novice programmer. I want to give my site the ability to remember users. I want to do this the easiest possible way--using cookies to store username and password--since I am not concerned...
3
1147
by: Manfred Bauer | last post by:
Dear all, I have written an ASP.NET application using NT-Authentfication against an Active Directory domain. Users that are logged on have access to an Outlook Web Access site, also using...
9
1834
by: Denise | last post by:
I have posted a similar message in 2 other forums but got no response. I have spent more hours than I can count researching this. Can anyone provide some insight...? Our ASP.Net application...
4
1481
by: Greg Smalter | last post by:
Redirecting from page to page within a web project is pretty easy. However, all Redirect methods take strings as arguments, as if you mistype the string, you don't find out until run time that you...
8
5758
by: Morpheus | last post by:
I am trying to test a function that outputs text to the standard output, presumably using a cout call. I do not have access to the source, but need to test the output. Is this possible? I can...
41
3179
by: amygdala | last post by:
Hello all, I have posted a similar question in comp.lang.php in the past, but haven't had any response to it then. I kinda swept the problem under the rug since then. But I would really like to...
9
2319
by: Jonathan Wood | last post by:
I've spent days trying to come up with a solution. I'd appreciate it if anyone can help. My site requires all users to log on. There are three different roles of users, and each user type will...
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4904
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4586
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
651
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.