Friday, January 24, 2025
HomeProgrammingHow to Redirect One HTML Page to Another on Load

How to Redirect One HTML Page to Another on Load

To redirect one HTML page to another automatically on page load, you can use the <meta> tag or JavaScript.

  1. Using the <meta> tag:
html
<meta http-equiv="refresh" content="3;url=https://www.example.com">

This will redirect the page to “https://www.example.com” after 3 seconds. You can change the number in content to adjust the delay.

  1. Using JavaScript:
html
<script>
window.location.href = "https://www.example.com";
</script>

This script will instantly redirect the page to the specified URL once it’s loaded.

See also  How Do I Remove A Directory From A Git Repository?

Both methods are commonly used for automatic redirection.

RELATED ARTICLES
0 0 votes
Article Rating

Leave a Reply

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
- Advertisment -

Most Popular

Recent Comments

0
Would love your thoughts, please comment.x
()
x