Learn about Automatic Redirection to New URLs in Internet Explorer 8

Article by John Garger (20,844 pts ) , published Oct 30, 2009

Sometimes it is necessary to redirect a website visitor to a new URL. Learn about Meta, HTTP 301, and HTTP 307 redirects.

The Internet changes quickly; companies change strategies, people change their minds, and competition for consumers’ attention can be a scarce commodity. One of the most important attributes about websites is that they are living documents; their content can change quickly.

There is one major problem with using a website as a living document. Hyperlinks coming into a site may be old, outdated, or point to a destination that no longer exists. Web designers demanded a tool that would allow links to remain permanent even though the document requested resides in a different location.

Internet Explorer 8 (IE8), like all of the major Internet browsers, supports what is known as a Meta redirect. Meta redirects allow a web designed to point a page to another document so that the user is not confronted with a 404 error (page not found). However, there are some caveats to using the Meta redirect. Luckily, several alternatives do not suffer from the same disadvantages of the Meta redirect.

How to Set Up a Meta Redirect

Meta tags are pieces of code on a webpage (htm, html, asp, aspx, php, etc.) that are invisible to the user. Normally found at the top of a webpage’s code, they define certain parameters and information used by servers, search engines, and browsers.

To insert a Meta Redirect into a webpage, locate the rest of the Meta tags at the top of the webpage’s code and place the following line as the last Meta tag on the page (without the single quotes at each end):

‘<META HTTP-EQUIV=REFRESH CONTENT="1; URL=http://www.new-url-here.com">’

This Meta tag tells a browser to redirect the page to http://www.new-url-here.com after 1 second. Of course, you can change the URL to any location you like and you can also change the CONTENT variable to any number. The CONTENT number represents the number of seconds the browser should wait before redirection. This gives your visitors a chance to read a message such as “you will be redirected in 5 seconds” so that the redirection is not abrupt.

Problems with Using Meta Redirects

Internet Explorer 8 recognizes this code and redirects a visitor to a new site after a pre-defined number of seconds. However, there are a few problems with using Meta redirects.

Search engines such as Google, Yahoo, and Microsoft Bing may interpret redirects as an attempt to garner more favor with the search engines than is warranted by the content of a page. Some black hat search engine optimization (SEO) techniques include putting one page up to rank well with the search engines and then redirecting visitors to another page or website.

You may not be engaged in any black hat SEO behavior, but by allowing IE8 to initiate the redirect, the bots that crawl the web for the search engines will not be able to tell the difference between honest and dishonest attempts to rank well. Meta Redirects also do not allow the “back” button on browsers to work because every time a user of IE8 presses the back button, the Meta Redirect will just keep redirecting to the new URL.

The World Wide Web Consortium has this to say about Meta Redirect:

“Imagine that the user presses the "back" button, the refresh would work again, and the user would bounce forward. The user will most likely get very annoyed, and close the window, which is probably not what you, as the author of this page, want.” http://www.w3.org/QA/Tips/reback

This is especially true for black hat web designers who use a value of zero for the Content variable. There are a host of other ways to redirect users to a new site without appearing to be using black hat SEO techniques but the most useful are what are known as HTTP 301 and HTTP 302 Redirects.

Showing page 1 of 2
Sponsors
 
Camtasia: record, save, share!
Record onscreen activity, your voice, and webcam video. See how great your presentation videos can look with Camtasia screen recording software!