Techniques for WCAG 2.0

On this page:

-

# H76: Using meta refresh to create an instant client-side redirect

## Applicability

HTML and XHTML

This technique relates to:

- Success Criterion 3.2.5 (Change on Request)
  - How to Meet 3.2.5 (Change on Request)
  - Understanding Success Criterion 3.2.5 (Change on Request)

## Description

The objective of this technique is to enable redirects on the client side without confusing the user. Redirects are preferably implemented on the server side (see SVR1: Implementing automatic redirects on the server side instead of on the client side (SERVER) ), but authors do not always have control over server-side technologies.

In HTML and XHTML, one can use the `meta` element with the value of the `http-equiv` attribute set to "Refresh" and the value of the `content` attribute set to "0" (meaning zero seconds), followed by the URI that the browser should request. It is important that the time-out is set to zero, to avoid that content is displayed before the new page is loaded. The page containing the redirect code should only contain information related to the redirect.

## Examples

### Example 1

Example Code:

     <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>The Tudors</title>
        <meta http-equiv="refresh" content="0;URL='http://thetudors.example.com/'" />
      </head>
      <body>
        <p>This page has moved to a <a href="http://thetudors.example.com/">
          theTudors.example.com</a>.</p>
      </body>
    </html>

## Resources

Resources are for information purposes only, no endorsement implied.

- See also F41: Failure of Success Criterion 2.2.1, 2.2.4, and 3.2.5 due to using meta refresh with a time-out.

## Related Techniques

- G110: Using an instant client-side redirect

## Tests

### Procedure

1. Find all `meta` elements in the document.

2. For each meta element, check if it contains the attribute `http-equiv` with value "refresh" (case-insensitive) and the `content` attribute with a number greater than 0 followed by `;'URL=anyURL'` (where anyURL stands for the URI that should replace the current page).

### Expected Results

Step 2 is false.

- Top
- Contents
- Intro
- Previous: Technique H75
- Next: Technique H77