To do a HTTP redirect using HTML you can simply use the following meta tag.

Sample HTML

<meta http-equiv="refresh" content="0; url=https://codesnippets.fesslersoft.de" />

the 0; is the Time in seconds before the page will be redirected.

Tip

Since there is always a chance that a redirect on a specific device does not work e.g. when javascript is turned off or so, it is in most cases the best way to do a server side redirect using status code 301 Moved Permanently. You shoul’d also place a text with a link to the redirect on the page like “if you are not redirected please follow this link”.

for more informations see Using meta refresh to create an instant client-side redirect, HTTP 301

One thought on “How to do a HTTP redirect using HTML”

Leave a Reply