documents » articles

Maintain Your Search Results with Redirection

When I had updated the look of Goshen Web Design, I had also changed the site layout for the better. However, this threw off the results for search engines directed to my site as they were pointing to the old file locations. This is mainly due to the fact that search engine databases are only updated every-so-often, even though their robots are out crawling the web. (You can read more about how Google updates their database for search results at this link).

I was interested in knowing if their was a simple work-around to maintain trafic without creating a new file location that you could do with HTML. Looking around, I discovered a parameter of the meta tag called http-equiv="refresh". It lets you reload the current page with the option of specifying a different file instead. Basically, this is how the syntax goes:

<meta http-equiv="refresh" content="0; URL='name of the file you want to redirect to' ">

Let's break this down piece-by-piece:

  1. You are creating a meta tag with two parameters: http-equiv, which is set to refresh, and content.

  2. The first part of the content parameter defines how many seconds you want to elapse before the page is refreshed. In our circumstance, since we are using this tag to redirect, our timeout is set to 0 so it will reload immediately.

  3. The URL section of content defines where we want the current page to redirect to. This works like any other filename (both relative or absolute) except that you need to enclose it in apstrophes instead of quotation marks. This is neccesary because the attributes of the content parameter were enclosed in quotation marks, so to avoid errors this filename has to be enclosed in the alternate method—with apostrophes. Therefore, you could make this tag work in just the opposite way: enclose the content attributes with apostrophes and enclose our filename with quotation marks.

With all that said, this is what my finished redirecting HTML file looks like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>Goshen Web Design Articles » Mailto Mastered</title>
<meta http-equiv="refresh" content="0; URL='../documents/archives/article1.htm'">
</head>
<body>
</body>
</html>

You will need to save this file in the same directory as the other file (the one you are redirecting to) used to be. I would make this file as simple as possible, since when browsing you are not going to get redirected until the page has finished loading. So all that you probably need is a meaningful title tag and your redirecting meta tag.

And now, your simple and efficient redirecting HTML file is ready to go! You have successfully maintained beneficial site traffic with those search results and still been able to keep your new file layout.

...written @ May 11, 2007