Syntax error How to redirect website after certain amount of time without JavaScript?

How to redirect website after certain amount of time without JavaScript?



To redirect from an HTML page, use the META Tag. With this, use the http-equiv attribute to provide an HTTP header for the value of the content attribute. The value of the content is the number of seconds; you want the page to redirect after.

Through this, you can automatically redirect your visitors to a new homepage. Set the content attribute to 0, if you want it to load immediately.

Example

The following is an example of redirecting current page to another page after 2 seconds.

Live Demo

<!DOCTYPE html>
<html>
   <head>
      <title>Redirection</title>
      <meta http-equiv = "refresh" content = "2; url = https://www.tutorialspoint.com" />
   </head>
   <body>
      <p>This page will redirect in 2 seconds.</p>
   </body>
</html>
Updated on: 2020-01-08T07:06:18+05:30

6K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements