Is it possible to set up a basic HTML page to redirect to another page on load?
Redirecting to another URL with JavaScript is pretty easy, we simply have to change the location property on the window object: window. location = "http://new-website.com"; JavaScript is weird though, there are LOTS of ways to do this.
Using button tag inside <a> tag: This method create a button inside anchor tag. The anchor tag redirect the web page into the given location. Adding styles as button to a link: This method create a simple anchor tag link and then apply some CSS property to makes it like a button.
To make page links in an HTML page, use the <a> and </a> tags, which are the tags used to define the links. The <a> tag indicates where the link starts and the </a> tag indicates where it ends. Whatever text gets added inside these tags, will work as a link. Add the URL for the link in the <a href=” ”>.
Try using:
<meta http-equiv="refresh" content="0; url=http://example.com/" />
Note: Place it in the head section.
Additionally for older browsers if you add a quick link in case it doesn't refresh correctly:
<p><a href="http://example.com/">Redirect</a></p>
Will appear as
Redirect
This will still allow you to get to where you're going with an additional click.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With