HTML Lessons - Meta Refresh - Loading Another Page Automatically
Return to HTML Lessons


Meta Refresh
If you move a page, how do you prevent visitors from getting a 404 Page Not Found error?

Use the meta Refresh tag. It makes any page automatically load any other page after an amount of time you choose.
Syntax: <meta http-equiv="refresh" content="0;url="http://www.baywalk.net">
The content parameter specifies the number of seconds before a new page is loaded.

The url field specifies the next website or page to load.

This is also handy when you want to keep people from browsing a directory that doesn't have an index.html file in it. Simply create a file like this:
<html>
<head>
<title>Connecting to Baywalk.net...</title>
<meta http-equiv="refresh" content="0;url="http://www.baywalk.net">
</head>
<body bgcolor="white" text="black">
<font size="4">
<center>
Now Connecting to Baywalk.net.....<br>
</center>
If your browser does not support redirection,
<a href="/">Click here</a> to head on into Baywalk.net.<br>
<br>
Also, you might want to upgrade your browser.<br>
Follow one of these links to download a newer version:<br>
<a href="http://www.mozilla.com">FireFox</a><br>
or <a href="http://www.microsoft.com">Microsoft Internet Explorer</a><br>
</body>
</html>


Top of Page