This is super easy, you just have to put this meta
tag inside head
tag of your html page.
Without URL
<meta http-equiv="refresh" content="600">
The value in content signifies the seconds after which you want the page to refresh.
<meta http-equiv="refresh" content="0; url=foobar.com/index.html">
Example
The redirects to the provided URL in 5 seconds. Set to 0 for an immediate redirect.
<meta http-equiv="refresh" content="5;url=http://example.com/" />
Bonus
Same thing you can achieve in php as -
<?php
header('Content-Type: text/html; charset=UTF-8');
header('Refresh: 5; url=somewhere/');
?>
With all that being said, I highly recommend you keep learning!
Thank you for reading this article. Please feel free to connect with me on LinkedIn and Twitter.
Top comments (0)