Dan Fergus Design > Student
Resources > Syllabus > Class
Schedule > Redirect Exercise
Fun with <meta> Tags / Redirect
Meta elements (tags) provide information about a given web page, most often to help search engines categorize them correctly, and are inserted into the HTML code in the <head>, thus are not visible to a user looking at the site. They were once used to store key words for search engines, but since 2002, no current search engine uses meta data for searches. Still, there are some useful functions.
- The Meta Description tag can be used to provide a short synopsis of the page content, which is used by some search engines like Yahoo.
<meta name="description" content="This web site is about bugs." />
- Meta tags can be used to specify the language of the site:
<meta name="language" content="en" />
<meta name="author" content="John Doe" />
<meta name="copyright" content="© 2006 Joe Doe Inc." />
<meta name="date" content="2006-02-04-T08:45:30-05:00" />
- Meta tags can also be used to refresh a page after a set period of time. The following code will cause the page to refresh after ten seconds:
<meta http-equiv="refresh" content="10" />
- A variation on refreshing is redirecting. A meta tag can be used to send the browser to a different web page after a set period of time has passed:
<meta http-equiv="refresh" content="10; url=http://www.google.com" />
It should be noted, however, that this method of redirecting is often discouraged in lieu of better methods. But it still works in a pinch.
Exercise: Redirect
Create three pages that continually rotate from one to the next.
- Create a new html document and call it "red.html". Save it to your root folder.
- Set the background color to red (#FF0000).
- On the page write (using an <h1>) "Here comes the Blue Page!" (or something along those lines).
- In the head, place the following meta tag:
<meta http-equiv="Refresh" content="2; url=blue.html">
- Now create two more documents called "blue.html" and "green.html" (you could just re-save the current document with those names to save typing).
- Give each the appropriate background color.
- Change the text so that the blue page says "here comes the Green Page!" and the green page says "Here comes the Red Page!"
- Change the meta tags so that the blue page points to the green page, and the green page points to the red page.
- Open one of the pages in a browser; it should start cycling through your three pages.
- Place all three pages in a folder called "redirect" and FTP it to your server space.
- Update your home page so that the Redirect link points to one of these three pages.
Point Breakdown
4 pts |
Went well above and beyond and created something special. |
3 pts |
Went above and beyond requirements (customized the pages; added additional pages, etc.). |
2 pts |
Did what was required. |
1 pts |
Missing one or more required elements or contains one or more errors. |
0 pts |
Poor showing; mostly incomplete or full of errors. |
Course Outline
Syllabus
Student Resources