Thu 14 Jul 2005
How to Redirect your Visitors when you Move or Rename a Page using HTML
Posted by Administrator under HTML , Languages and ToolsThere are many reasons you might need to move or rename a page on your site. For example you want to:
- Rename a web-page to improve the keyword content of a URL
- Remove a page altogether but redirect to a completely new page
- Consolidate two or more pages into one page.
- Move a page to a new site.
You could just go ahead and delete the old page(s) but you risk losing visitors in doing so. Search engines typically take days, weeks or even months to pick up removal of pages (depending on your search ranking) and thus you risk having site visitors getting the dreaded 404 message instead of attracting them to your site content. Worse yet, other sites which may have been linking to your old page will now be sending traffic to a dead page. The following code is simple and when placed in the old page will allow automatic redirection to the new site page.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
“http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<title>PAGE TITLE TO BE REPLACED</title>
<META HTTP-EQUIV=”Refresh”
CONTENT=”2; URL=http://NEW_PAGE_URL.HTM“>
</head>
<body>
<blockquote>
This page has moved. If your browser doesn’t automatically redirect to
its new location in 5 seconds, click <a href=”http://NEW_PAGE_URL.HTM“>
here</a>.
</blockquote>
</body>
</html>
Simplify replace the “NEW_PAGE_URL.HTM” part with the URL of your page, update the page title and your done. As always, make sure you test your code!
PS. If you like this code sample, please link to our site (http://www.webmastersloom.com). It will be much appreciated. 