Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect from an HTML page

Is it possible to set up a basic HTML page to redirect to another page on load?

like image 850
chobo Avatar asked Mar 23 '11 20:03

chobo


People also ask

How do I redirect a Web page to a specific URL?

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.

How do I create a redirect Button in HTML?

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.

How do I link one HTML page to another HTML page?

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=” ”>.


1 Answers

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.

like image 160
Valerij Avatar answered Oct 05 '22 23:10

Valerij