Today I Learned - Rocky Kev

TIL the meta refresh redirect method

POSTED ON:

TAGS:

There's a pure HTML way to refresh/redirect your user.

A Meta refresh redirect is a client-side redirect. Unlike 301 and 302 redirects that happen on the web server, a meta refresh redirect instructs the web browser to go to a different web page after a specified time span.

<head>
  <meta http-equiv="refresh" content="4; URL='https://ahrefs.com/blog/301-redirects/'" />
</head>

That 4 in the content attribute represents 4 seconds.

Why you shouldn't use it:

The MDN

via What is 'meta refresh redirect' and why is it considered a critical issue?


Related TILs

Tagged:

TIL Gmail has a 102KB size-limit for HTML

PLACEHOLDER

TIL how Error correction works in HTML

You never get an 'Invalid Syntax' error on an HTML page. Browsers fix any invalid content and go on.

TIL what DOCTYPE means

tl;dr: DOCTYPE declaration in the first line of the HTML file, to instruct the browser to run the code in Standard mode.