Thank to Martijn (@sexybiggetje) , Erik's Link Shortener is up and running :D

For anyone else who wants to have their own easy link shortener: codeberg.org/sexybiggetje/els

Amazing! Thanks for all the other suggestions, if I find myself in times of plenty, I might look at it :P

@Erik @sexybiggetje

Congrats! But, reading the source, I cannot but wonder: would this not work much easier with a simple .htaccess or nginx redirect-map.conf.

It seems to do the exact same, but with an additional layer of complexity and slowness on top (php).

Not meant as criticism on launching (again: congrats!) just my curiousity after building and hosting several link shorteners myself.

Follow

@berkes @Erik

I wasn't sure what the hosting setup was. This allowed me to swap out the .htaccess for another redirect mechanism. I also wasn't sure if Erik would need any other features like link tracking, which could now easily append to it. Simple and effective enough right.

Β· Β· Web Β· 2 Β· 0 Β· 1

@sexybiggetje @Erik My last shortener has additional POST / and PUT / endpoints that allow creating and replacing urls too (using a hardcoded token as security, lol).

That way, one can manage it with curl or a bookmarklet.

Might be a neat next step?

@sexybiggetje @Erik I've experimented with ephemeral URL shortners too. That don't need any storage.

Some PHP pseudocode to explain the idea here gist.github.com/berkes/aa4ada2 (yes, I haven't written PHP in over 14 years, lol).

Idea is to decode/encode the URL using e.g. base64 or base85 (legibility). I've also tried compression algos, but representing that in url is hard.

It won't shorten much. Most usefull if you can remove the domain from long urls when you only redirect to e.g. your own blog.

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!