Click to See Complete Forum and Search --> : [RESOLVED] Moved My Home Page


ThaiAm
07-16-2006, 08:56 PM
I have moved my home page from www.waynes.net/wayne to www.waynes.net
I want the index page at www.waynes.net/wayne to automatically go to the new site after a few seconds and cannot find a way to do it.

Help Please...

Albatross
07-16-2006, 09:24 PM
Create a Web page explaining what happened, and put this in the <head> section, below the <title> tag:

<meta http-equiv="Refresh" content="4;url=http://www.waynes.net" />

Be sure to remove the / from the meta tag if you're not using XHTML.

pcthug
07-16-2006, 09:31 PM
Replace the index page at www.waynes.net/wayne with one of the following methods:
ASP/VBScript:
<%@ Language=VBScript %>
<%
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.waynes.net"
Response.End
%>
PHP:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Refresh: 2; URL=http://www.waynes.net");
die('This page has moved to <a href="http://www.waynes.net">http://www.waynes.net</a>');
?>
ColdFusion:
<CFHEADER statuscode="301" statustext="Moved Permanently">
<CFHEADER name="Location" value="http://www.waynes.net">
Javascript:

<html>
<head>
<script type="text/javascript">
window.location.href='http://www.waynes.net';
</script>
</head>
<body>
This page has moved to <a href="http://www.waynes.net">http://www.waynes.net</a>
</body>
</html>

Or just Plain HTML:

<html>
<head>
<meta http-equiv="refresh" content="2;url=http://www.waynes.net">
</head>
<body>
This page has moved to <a href="http://www.waynes.net">http://www.waynes.net</a>
</body>
</html>

ThaiAm
07-16-2006, 10:06 PM
Thanks to both of you for your careful response. I have made the needed changes to the page as a result of this input and am grateful to you for taking the time to hold my hand and so generously share your knowledge.

Thanks and well done.

Albatross
07-16-2006, 10:35 PM
No problem.

pcthug
07-16-2006, 10:45 PM
ThaiAm I would suggest using the server-side methods if available because:

They set a 301 HTTP header which will tell search engines that the page has moved.
They are alot more secure and have a much higher chance of successfully redirecting to the new address

Albatross
07-16-2006, 10:48 PM
I definately agree with pcthug on this one. I didn't mention the server-side option because I don't know what server you're on (not about to go finding out either). Also, a lot of people use free hosting providers, which do not allow people to use server-side programming languages unless they pay through the nose for a "premium account."