Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML redirect page markup

Tags:

html

I have an HTML error page which I am looking to redirect users from. For example; if the user receives the error page then they will be instantly redirected to a webpage (http://www.domain.com/).

How can I do this in pure HTML and nothing else so it will work in all browsers? What markup should I use?

like image 949
Callum Whyte Avatar asked Jul 05 '26 13:07

Callum Whyte


2 Answers

<meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com"></HEAD>

where content equals the time in seconds to redirect (say you want to pause on that page, then the page where you want to redirect to.

Make sure you include this in the head of the error page.

like image 124
huzzah Avatar answered Jul 07 '26 04:07

huzzah


Using JavaScript, you can put these three lines:

<script language="javascript">

window.location.href = "http://example.com"

</script>

like image 36
Timtech Avatar answered Jul 07 '26 04:07

Timtech



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!