Redirect page in HTML

To redirect user to another page directly in browser (without using server-side and HTTP error codes) one just have to add this to <head> section of HTML document:

<meta http-equiv="refresh" content="x; url=http://.../page.html"/>

Where x means number of seconds after each the redirection is happening.

This is just to remind me, what to use in this case. Nothing more.

Note that there is a long-time known confusion in the Internet that W3C discourages using meta refresh (the above technique) in favor of server redirects. While server-side solution is in most cases better than client redirect, we must ready W3C statement with understanding.

Using this method for refreshing current page (the original purpose of meta refresh) on periodic basis is highly discouraged, because it can confuse visitors. When you are using it for actual page redirect — there is nothing wrong about this!

One of trillions of sources for this in the web: How to redirect one HTML page to another on load.

Leave a Reply