HTML redirect


Home - Tutorials - Basics

This article demonstrates how to use HTML redirect to send your visitors to an other location automatically.

Tutorial info:


Name:HTML redirect
Total steps:1
Category:Basics
Date:2009-04-21
Level:Beginner
Product:See complete product
Viewed:19723

Bookmark HTML redirect



AddThis Social Bookmark Button

Step 1 - Using HTML redirect


HTML redirect

It is a very common problem that you want to send (redirect) the visitors to an other web page.  For example if you have new site and want that the visitors visiting your old site to be informed about the changes and of course automatically redirected to the new site. 

Fortunately the solution is quite simple. You can use a HTML meta tag to redirect your visitors. The syntax is the following:

Code:
  1. <meta http-equiv="refresh" content="3; url=http://www.htmlf1.com/" />
  2.  

 

This code should be placed inside the head section of your HTML code.

The parameters:

The "http-equiv" parameter must be set to "refresh". This parameter tells to the browser the the content must be refreshed (updated).

The "content" parameter defines when to refresh the content. This time interval is in seconds. Besides this you can define your alternative url here. If the content has no url part then your page will be simply reloaded. However if you define an url location here then your browser will be load the url you specified after the time interval is over.

HTML redirect examples:

Reload the actual content in every 10 seconds:

Code:
  1. <meta http-equiv="refresh" content="10" />
  2.  

 

Redirect your visitor immediately to an other web page.

Code:
  1. <meta http-equiv="refresh" content="0; url=http://www.htmlf1.com/" />
  2.  

 

Redirect your visitor after 3 seconds to an other web page.

Code:
  1. <meta http-equiv="refresh" content="3; url=http://www.htmlf1.com/" />
  2.  

 

A complete HTML redirect example with head and body section:

Code:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3.  
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <meta http-equiv="refresh" content="3; url=http://www.htmlf1.com/" />
  6. <title>HTML redirect example</title>
  7. </head>
  8.  
  9. <h1>This page will be redirected in 3 seconds!</h1>
  10. </body>
  11. </html>
  12.  






Tags: html redirect page, html redirect, html, redirect

HTML redirect - Table of contents
Step 1 - Using HTML redirect


Host Addon Ltd

F1 Site Family
AJAX F1
CSS F1
Database F1
Flash F1
HTML F1
Java F1
JavaScript F1
PhotoShop F1
PHP F1
Scripts F1
Tutorial F1
Windows F1

Total time: 0.0537