Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You could also push static HTML pages to the git root which have, e.g.,

<meta http-equiv="refresh" content="1; url='https://news.ycombinator.com/'" />

in the header.



I reckon it'll be possible to "simplify" it even more for an end-user, by making a static site generator generate these redirect HTML files from markdown or a CSV.


Some guy shared his project in this post that does exactly that! Yes while that is possible and can get to a high level of automation via GitHub actions, the point of my URL shortener was more of people could post a link easily with a simple interface (like the interface for adding a new issue). But if I were operating with a fixed set of short links, then this would have been a good method!


I did exactly as you said, about a year or two ago, using Jekyll.

https://gitlab.com/davch/static-redirect



I am not familiar with this, could you explain what will happen?


for browsers that load the page that contains that stanza and respect meta refresh, it will refresh and redirect you to the url=.


It will redirect to the url.


Any particular reason why you wrote 1 rather than 0?


Not really. Copied it from somewhere else where the placeholder value was 7. 1 came to my mind before 0. Zero seems like it could be UB.


Nah, zero just means “redirect after zero seconds”, meaning immediately. You definitely want zero.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: