How to redirect a page to another page in HTML ?

To redirect from an HTML page to another page you can use the <meta> tag. It is the client-side redirection, the browsers request the server to provide another page. Also, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value in the content attribute is the number of seconds, you want the page to redirect after. For immediate loading, you can set it to 0. Some browsers don’t correctly render the refresh tag. There the user may see a message before the next page loading. Some old browsers don’t correctly refresh when you add such quick links. In that case, you should add an anchor link to let the user follow to next page.

Syntax:

<meta http-equiv = "refresh" content = " time ; url = link"/>

Examples:



filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html> 
<html
  
<head
    <title>HTML Redirect</title
    <meta http-equiv="refresh"
        content="5; url = https://ide.geeksforgeeks.org" /> 
</head
  
<body
    <h1 style="text-align:center;color:green;"
         GeeksforGeeks 
    </h1
      
    <p style="text-align:center;"
        If your browser supports Refresh, 
        you'll be redirected to GeeksforGeeks 
        Homepage, in 5 seconds. 
    </p
</body
  
</html

chevron_right


Output:

Supported Browsers: The browsers supported by HTML Redirect are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera


My Personal Notes arrow_drop_up


If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.




Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.