Meta Refresh Tags

Some web pages, webcams being an excellent example, require an automatic refresh in order to show the most recent information displayed by the page. Meta refresh tags make automatic page reloads a snap!

Let’s continue with the webcam example. The webcam has been set up, and you have it feeding images to a web page on your site, but it only shows one image at a time. Instead of forcing your visitors to click the Refresh or Reload button every time they want to see a fresh image you can add meta refresh tags to your page and it will automatically refresh itself.

Meta tags need to go between the “head” tags in your existing HTML page. Look for the following tags in your page code:

<head>

</head>

You may discover that you already have some meta tags present in your page code inside the head tags. If that is the case simply add the new refresh tag to the existing set of meta tags.

The meta refresh tag below will cause a page to automatically refresh every 15 seconds:

<meta http-equiv="refresh" content="15">

Put together, a simple webcam page could look like this:

<html>

<head>
<title>Webcam Page - 15 Second Auto Refresh</title>
<meta http-equiv="refresh" content="15">
</head>

<body>
<img src="images/webcam/current.jpg">
</body>

</html>

This code displays the file current.jpg from the domain user’s local directory called images. On a standard cPanel server the full path to this directory would be similar to /home/username/public_html/images .

While the meta refresh tag can be used to redirect one page to a different page or web site it is strongly recommended that you utilize HTTP Redirects instead as they provide more information and will help transition site traffic more smoothly. Meta refresh tags should be used primarily on pages that need to refresh themselves, not direct traffic to a different page.

If you are set on using the meta refresh tag to redirect one page to another just add the target URL after the refresh time as seen below:

<meta http-equiv="refresh" content="15;http://www.google.com">

This code, added inside the head tags, will display your page for 15 seconds and then automatically point the vistor’s browser to google.com.

As always we strongly recommend that you create a backup copy of a file before you modify it!

===

Liquid Web’s Heroic Support is always available to assist customers with this or any other issue. If you need our assistance please contact us:
Toll Free 1.800.580.4985
International 517.322.0434
support@liquidweb.com
https://manage.liquidweb.com/

Be Sociable, Share!
Here's $75, Launch a New VPS Today. Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7 Heroic Support.