Site Map - skip to main content

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.


hpr2904 :: DIY URL shortening

Quick tip on how to shorten an URL without a silly SaaS

<< First, < Previous, , Latest >>

Hosted by Klaatu on 2019-09-19 is flagged as Clean and is released under a CC-BY-SA license.
html, url shortner.
Listen in ogg, spx, or mp3 format. | Comments (1).

general.

Make a directory to house your shortened URLs.


$ ssh example.com mkdir public_html/u

On demand, create a subdirectory for the shortened URL you want to create.


$ ssh example.com mkdir public_html/u/hpr

Create an HTTP redirect in an index.html file.


$ ssh example.com echo ""<html><title>Shortened URL</title><head><meta http-equiv='refresh' content='0; URL=http://hackerpublicradio.org/correspondents.php?hostid=78' /></head></html>"" > www/u/hpr/index.html

Your shortened URL is example.com/u/hpr


Comments

Subscribe to the comments RSS feed.

Comment #1 posted on 2019-09-23 11:16:43 by tuturto

clever

Really clever way of doing this. When I saw the headline, my mind started immediately working through all kinds of algorithms one could use shortening urls. Turns out, nothing complicated is needed.

Leave Comment

Note to Verbose Commenters
If you can't fit everything you want to say in the comment below then you really should record a response show instead.

Note to Spammers
All comments are moderated. All links are checked by humans. We strip out all html. Feel free to record a show about yourself, or your industry, or any other topic we may find interesting. We also check shows for spam :).

Provide feedback
Your Name/Handle:
Title:
Comment:
Anti Spam Question: What does the P in HPR stand for ?