from Hacker News

I just learned about HTML redirects (2020)

by sc90 on 4/22/23, 7:52 PM with 81 comments

  • by gbraad on 4/22/23, 11:48 PM

    I remember once learning that php has a `header` function and have been using 'location:...' since ever (pre-2000) as php was almost always supported by hosters like dreamhost, hostgator, and nearly every Linux install came pre-installed with Apache and the php mod. The meta htttp-equiv was a last resort (like gh-pages). Never really used the JS option unless it was part of the application.
  • by handsclean on 4/22/23, 11:15 PM

    This is also used as a poor man’s live feed: just use this element to reload the page or frame on a set interval.
  • by aendruk on 4/23/23, 12:22 AM

    Ah, and next you might discover one of my favorite unresolved browser issues:

    https://bugs.chromium.org/p/chromium/issues/detail?id=63107

  • by Reptur on 4/22/23, 11:11 PM

    My fav was Marquee. Could put one inside the other, make one vertical, add some text and watch it bounce around like the DVD screensaver logo.
  • by moritzwarhier on 4/22/23, 10:39 PM

    I remember these from when I initially taught myself HTML (4) and CSS as a kid.

    It's kind of amazing how parts of the spec that seem dated or obsolete can still be useful today and are even widely used in corner cases.

  • by kristopolous on 4/23/23, 6:07 AM

    Combining it with the referrer tag and you can make some pretty interesting graphs. With frames you can even do Floyd's algorithm.

    I made a demo of this about 20 years ago but I think it just confused people. One of my early flops that I thought was cool. It was all in perl and I think there was some JS in there as well but I don't remember anymore. No idea where it is now.

    Rewrite it and make a hyped up pitch page. People will call you a genius and I'll pretend not to care

  • by pooper on 4/23/23, 12:35 AM

    I was so sure archive.is/wip/xxxxxx used this but I just checked and it uses

    <script>{setInterval(function(){document.location.reload();},5000)}</script>

    now

    for example, I tried out view-source:https://archive.fo/wip/RpDSg

    does anyone else remember seeing meta refresh? if so, any idea why they switched to javascript reload

  • by stuckkeys on 4/22/23, 11:02 PM

    Ahh. This brings back memories. I used to do this when I was using Adobe (Macromedia originally) FLASH back in the day. If no FLASH, show them the shitty version. HAHA. Good times.
  • by GrumpyNl on 4/23/23, 8:56 AM

    Sometimes im flabbergasted on how the most basic html knowledge is lost on newer generations.
  • by dmd on 4/22/23, 11:24 PM

    Ok, I'll bite - how else do people do this? (Speaking as someone who has ONLY ever done it this way.)
  • by masenf on 4/23/23, 5:17 AM

    I've recently deployed this trick on my company's confluence instance (with an HTML macro) to create a "poor man's" link shortener that allows me to change the link target after the fact.

    Also recently deployed it as a very simple server side denounce: when the client first accesses page X a long running operation is dispatched. Subsequent requests for the same resource before it's done processing return a plain HTML response that says "Still thinking about it" and meta refresh after 1 second.

  • by crooked-v on 4/23/23, 12:18 AM

    This reminds me of the days of making text adventures that used a width 0 frame to store background variables.
  • by 9034725985 on 4/23/23, 12:54 AM

    I use

    <meta http-equiv="refresh" content="300"> to do speed test from fast.com

    see:

    view-source:https://angularten.github.io/

  • by latchkey on 4/23/23, 3:39 AM

    I remember when it was released as a new feature (~1995).
  • by TRiG_Ireland on 4/22/23, 11:42 PM

    Amazing that these were forgotten!
  • by rawbert on 4/23/23, 1:30 PM

    Hehe, the good old html meta redirect. As a kid in the early days of the web I loved to post redirects to porn websites in guestbooks to check if the website was sanitizing the user content properly. Worked way to often :D
  • by mikece on 4/23/23, 11:14 AM

    This reminds me that while I’ve been programming for a paycheck since 1998 my knowledge growth in html stopped at about 2001. Are there any good courses or recommendations for seasoned pros who never stopped to learn HTML5?
  • by javajosh on 4/22/23, 11:25 PM

    I use this trick to autorefresh the resource that I'm working on.
  • by moltar on 4/23/23, 4:02 AM

    Putting 0 value used to be a bad idea, as it was a signal to the browser and various ad blockers and anti viruses that it was a rogue redirect. Wonder if it’s different these days?
  • by bryanrasmussen on 4/23/23, 12:36 AM

    when they just learned about it was in 2020.
  • by fergie on 4/23/23, 9:47 AM

    Goddammit!
  • by Uptrenda on 4/23/23, 1:57 PM

    Noob learns basic HTML tag. The post.