22.04.2013 Views

HTML, XHTML & CSS

HTML, XHTML & CSS

HTML, XHTML & CSS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

70<br />

Part II: Formatting Web Pages with (X)<strong>HTML</strong><br />

To instruct a browser to redirect users from one page to another, here’s what<br />

you need to do in particular:<br />

1. Use the element with http-equiv=”refresh”.<br />

2. Adjust the value of content to specify how many seconds before the<br />

refresh happens and what URL you want to jump to.<br />

For example, the element line in the following markup creates a<br />

refresh that jumps to www.w3.org after 15 seconds:<br />

<br />

<br />

<br />

All About Markup<br />

<br />

<br />

<br />

<br />

This page is still in development. Until we are done, please visit<br />

the W3C Website for the definitive<br />

collection of markup-related resources.<br />

<br />

Please wait 10 seconds to be automatically redirected to the W3C.<br />

<br />

<br />

Use metadata with caution when redirecting a Web page. When some<br />

search engines see metadata redirects in use, they think the site is trying<br />

to spam. This could result in your Web site or page being delisted, or<br />

removed from the search engine’s listings. When you become a pro at using<br />

metadata to redirect, you can step up to the next level and try redirecting<br />

using the HTTP code number 301 to force a server-based redirect from an<br />

*.htaccess file located in the root directory on your Web server. While<br />

server-based 301 redirects are outside the scope of this book, a simple<br />

Google search can lead you to a number of good resources such as the<br />

.htaccess file Redirect/Rewrite Tutorial on Master Site Manager located<br />

at www.mastersitemanager.com/857/301-htaccess-redirecttutorial.<br />

Older Web browsers may not know what to do with elements that<br />

use the http-equiv element to redirect a page. Be sure to include some text<br />

and a link on the page so a visitor can link manually to your new target page<br />

if your element fails to work. Linking, which uses the anchor ()<br />

element, is discussed in Chapter 3.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!