To redirect to another page using HTML when a page loads, you can use the following code inside the <head>
section of your HTML document:
<meta http-equiv="refresh" content="0; url=http://example.com/" />
Here, content
attribute specifies the time delay (in seconds) before redirecting and url
attribute specifies the URL to which the page should be redirected.
HTML redirects to another page on the load example
Simple example code.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="0; url=https://eyehunts.com">
</head>
<body>
<h1>Hello, World!</h1>
</body>
</html>
Output:
In web development, redirect refers to the process of sending a user from one URL to a different URL. Redirects can also be useful for resolving broken links and improving the user experience on a website.
Do comment if you have any doubts or suggestions on this webpage topic.
Note: The All HTML Examples codes are tested on the Firefox browser and the Chrome browser.
OS: Windows 10
Code: HTML 5 Version