Creating a redirect page



This is one that comes in handy a lot. Like many things in computing there are a number of ways to accomplish this. My favorite though is one fo the simplest.

But first, it’s probably worth asking why you would want a redirect page and just clarify what I mean. Let’s say you’ve moved your main site entry page. It used to be homepage.html and now it’s index.php. You don’t want traffic to be going to homepage.html and browsing the old site, or you want to get rid of it entirely and make them come to index.php. If they just bookmarked your domain name it’s probably no big deal, the webserver will automatically serve up the correct page, but IF they bookmarked homepage.html specifically (www.yourdomain.com/homepage.html) then your visitors will see an error 404 page not found. Some might be clever and remove the page name looking to see what else is there, but don’t count on that.

So you want a page that takes someone visiting it (say we name it homepage.html) and moves them to your main page. Here’s an easy way.

Create a very simple web document…

<html>
<head>

</head>
<body>
</body>
</html>

That’s the minimum we need for a blank web page. Now, between <head> and </head> add a line like this.

<meta http-equiv=”refresh” CONTENT=”5; URL=http://pageoraddressyouwanttoredirectto”>
</meta>

Basically this is a meta tag that redirects the browser automatically. It takes two variables after Content…. the first is how many seconds before the redirect and the second is the address that you’re redirecting to. Now, if you want someone to read a message on the page, you might choose 10 or 15 seconds. If you just want to move them, I’ll choose 0 sometimes. 5 is enough to read the text that we might place to explain.

Between the <body> and </body> tags insert a line like this.

<p> You are being redirected to the correct page. If you’re browser doesn’t automatically redirect please click the link below </p>
<a href=”http://pageoraddressyouwanttoredirectto”>My new Page</a>

At this point save it and your done. Of course, you can get fancier, theme it to match your new site, add a title, etc. etc. But it can be a VERY simple start and maybe hang on to those that are following outdated links (or search engine crawlers that might reindex your site.)

Related Posts

Blog Traffic Exchange Related Posts
  • Translating web pages I don't know if I've mentioned it before here, but languages are one of the things that fascinate me. I've studied Spanish, German and French. Although right now I would barely be able to recognize a handful of words in German and French. Of late, spanish has been the language......
  • Web translation I found this link of plugins for wordpress to aid in multilingual site building. I've been experimenting with English/Spanish designs of one site I maintain using plain html (index.html.en index.html.es and the server gives the correct page depending on the browser localization. It seems as though there was an .htaccess......
  • The Google Problem, or why I'm starting to use MSN and Yahoo more. This weekend has been a bit of an introspective for me on why google is still the primary search engine I use. I know, I've been a big "fan(?)" of google for quite some time, I've obviously incorporated many of their products into my pages and used Google for 99%......
Blog Traffic Exchange Related Websites
  • Search Engines Future Ever since Google started growing around the turn of the millennium, they have been updating their algorithms and hardware to give their users the best experience possible. On the opposite side of that, spammers have been constantly finding new ways to abuse the system to rank for very competitive......
  • Does Your Google Page Rank Really Affect Your Corporate Blog? Spend a few weeks reading about search engine optimization and you’ll likely become obsessed with your Google page rank score. If you’re not familiar with this, it is a system employed by Google that determines the popularity of a site and then assigns a ranking to it. Many factors are......
  • Ebay Bought Me A Laptop! Check out the new laptop I got courtesy of Ebay.com! No, I didn't buy a laptop on ebay, but I did use the money ebay sent me to buy a really nice notebook. You can learn more about the configuration of the 16 inch intel core 2 duo HP......
www.pdf24.org    Send article as PDF   

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

One Response to “Creating a redirect page”

  1. Avery J. Parker - Web site hosting and computer service Says:


    [...] Just a note to mention that I’ve updated a page that I published a good while back. It’s kind of a funny story. I skimmed through the logs and saw that someone got here on a search for how to create redirect pages, and had forgotten about the post, I looked to see what it was. I was redirected in about 5 seconds to a google search. (Firefox uses text in the address bar to the default search provider….) Ummmm… ok something’s not right, so… [...]


Switch to our mobile site