HTML Meta Refresh Redirect Tutorial & Code

A comprehensive tutorial on creating HTML meta refresh redirects with zero-second and countdown delay syntax, JavaScript fallbacks, and search engine best practices.

What is an HTML Meta Refresh Redirect?

An HTML meta refresh redirect is a client-side instruction placed inside the <head> section of an HTML document that instructs the visitor's web browser to automatically reload or navigate to a new URL after a specified number of seconds.

1. Instant Redirect (0 Seconds)

To forward the browser immediately without displaying the current page:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="refresh" content="0; url=https://www.rapidtables.online/web-design.html"> <link rel="canonical" href="https://www.rapidtables.online/web-design.html"> <script>window.location.replace("https://www.rapidtables.online/web-design.html");</script> <title>Redirecting...</title> </head> <body> <p>Redirecting... If you are not redirected automatically, <a href="https://www.rapidtables.online/web-design.html">click here</a>.</p> </body> </html>

2. Delayed Redirect with Message (e.g. 5 Seconds)

To display an informational notice before redirecting:

<meta http-equiv="refresh" content="5; url=https://www.rapidtables.online/new-tool.html">

HTML Meta Refresh vs Server-Side 301 Redirect

  • SEO Ranking: Search engines prefer server-side 301 redirects (via Apache .htaccess or Nginx) because they explicitly signal permanent moves and pass 100% link equity. Google treats zero-second meta refresh tags as 301s, but delayed meta refresh tags (over 1 second) are treated as temporary 302 redirects.
  • User Experience: Meta redirects can break the browser "Back" button if implemented without window.location.replace().
  • Static Hosting Support: Meta refresh is useful on static hosting platforms (like GitHub Pages or basic CDNs) where server configuration files like .htaccess are not supported.