How to use Meta Tag to redirect an HTML page?

Page redirection is a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection.

To use a META Tag to redirect your site is quite easy. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute.

Browser <meta http-equiv="refresh" content="2; url=new-page.html"/> Wait 2 seconds Redirects to New Page Destination Page Meta Refresh Process

The following is an example of redirecting current page to another page after 2 seconds. If you want to redirect page immediately then do not specify the content attribute or set it to 0.

Syntax

<meta http-equiv="refresh" content="seconds; url=destination-url" />

Parameters

  • http-equiv="refresh": Tells the browser this is a refresh instruction
  • content: Contains the delay in seconds and the destination URL
  • url: The target page to redirect to

Example: Redirect After 2 Seconds

<!DOCTYPE html>
<html>
   <head>
      <title>HTML Meta Tag Redirect</title>
      <meta http-equiv="refresh" content="2; url=https://www.tutorialspoint.com" />
   </head>
   <body>
      <p>This page will redirect to TutorialsPoint in 2 seconds...</p>
   </body>
</html>

Example: Immediate Redirect

<!DOCTYPE html>
<html>
   <head>
      <title>Immediate Redirect</title>
      <meta http-equiv="refresh" content="0; url=https://www.example.com" />
   </head>
   <body>
      <p>Redirecting now...</p>
   </body>
</html>

Common Use Cases

  • Site maintenance: Redirect users to a maintenance page
  • URL changes: Automatically redirect from old URLs to new ones
  • Mobile detection: Redirect to mobile-optimized versions
  • Geographic redirection: Send users to region-specific pages

Key Points

  • Meta refresh is processed by the browser, not the server
  • Search engines may not follow meta refresh redirects for SEO
  • Users can see the original page briefly before redirection
  • For SEO purposes, server-side redirects (301/302) are preferred

Conclusion

Meta tag redirects provide a simple HTML-based way to redirect pages after a specified delay. While easy to implement, consider server-side redirects for better SEO performance and user experience.

Updated on: 2026-03-15T23:18:59+05:30

13K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements