You are currently viewing the United Kingdom version of the site.
Would you like to switch to your local site?
13 MIN READ TIME

TUTORIALS Shorten your URLs

Build your own URL shortening service

WEB APPLICATION

Tiring of typing multiple characters and back-slashes, David Rutland sets out on a journey of creating his own URL shortening system.

OUR EXPERT

David Rutland is a tinkerer and a dilettante. He buys domains on whims and runs them from a Raspberry Pi behind the couch.

N ext time you follow a link to an article online, take a look at the address in your URL bar.

Provided the browser you’re using doesn’t hide most of it, you’ll probably notice that the actual address is somewhere in the region of 70 to 100 characters long.

That’s not a problem when you’re copying into an email, or clicking from one site to another, but have you considered what happened if you’re reading over the phone to your nan? Or painstakingly copying it character for character from the glossy printed pages of your favourite Linux-centric (who’s that?–Ed) publication? It takes forever and one slip-up means that you have to start the entire thing again.

Keeping things simple

Here at Linux Format, we use the bit.lyservice to shorten URLs for us. Feeding the full length address into the bit. ly site spits back a short, easy-to-remember string of characters. Typing that string into your browser results in you being redirected to the original URL from which the short string was generated.

As an example, if you put bit.ly/37Ws4y2into your browser, you’ll be taken to the Linux Format subscription page. That’s 99 characters condensed down to a mere 14, and if you already know that we use bit.ly, you only need to remember seven characters. It’s like magic.

Organising a domain by post is a new one to us.

But bit.ly– and services like it – are owned by other people. At the whim of another human being all of our carefully curated links could vanish. The domain could be sold, the terms and conditions could change, or God forbid, we could transgress some unread content policy causing our account to be cancelled.

URL shortening services are an example of a cloudbased service, It’s an old but true adage that cloud computing just means relying on somebody else’s machine. It would be fantastic if you free yourself of the shackles of Big Shortener by running your own service. Perhaps from that underused Raspberry Pi that’s tucked away in the corner of your living room.

Bit.ly is great but we don’t want to deal with obnoxious popups, cookie dialogues, and the sheer nonexclusivity of it.

In the world of URL shorteners, brevity is king, and a 17-character base domain rather defeats the point. You might think that in the almost 30 years since the first domains were registered, that all of the good ones – or at least the short ones – had been taken snatched up and are currently being squatted in the hopes of making their owners rich, but you’re wrong. If you’re prepared to look further afield, great names can be had.

Unlock this article and much more with
You can enjoy:
Enjoy this edition in full
Instant access to 600+ titles
Thousands of back issues
No contract or commitment
Try for 99p
SUBSCRIBE NOW
30 day trial, then just £9.99 / month. Cancel anytime. New subscribers only.


Learn more
Pocketmags Plus
Pocketmags Plus

This article is from...


View Issues
Linux Format
June 2021
VIEW IN STORE

Other Articles in this Issue


WELCOME
LINUX FORMAT
MEET THE TEAM
No free lunches
They’re not Google’s photos, they’re mine! To the
REGULARS AT A GLANCE
The right to repair movement gains steam
HARDWARE
Google wins copyright case
COPYRIGHT
Ubuntu working on Windows
OPERATING SYSTEMS
YOUR DATA IS YOURS
Matt Yonkovit is Percona’s Head of Open Source
HORSES & COURSES
OPINION
IBM’s COBOL comes to Linux
PROGRAMMING
Librem 5 progress
HARDWARE
New Android Bluetooth stack
ANDROID
Distro Watch
What’s down the side of the free software sofa?
PANFROST TO VULKAN
OPINION
HERE’S STALLMAN
OPINION
Kernel Watch
Jon Masters summarises the latest happenings in the Linux kernel, so that you don’t have to
Answers
Got a burning question about open source or the kernel? Whatever your level, email it to lxf.answers@futurenet.com
Mailserver
WRITE TO US Do you have a burning
Audacity
Version: 3.0 Web: www.audacityteam.org Hot off the
Clapper
Version: 0.1.0 Web: https://github.com/ Rafostar/clapper A t
Haguichi
Version: 1.4.3 Web: https://github.com/ ztefn/haguichi T ime to
Media Downloader
Version: 1.1.0 Web: https://github.com/ mhogomchungu/media-downloader L ately
Panon
Version: 0.4.6 Web: https://github.com/rbn42/panon C alling all
Radiotray-NG
Version: 0.2.7 Web: https://github.com/ebruck/radiotray-ng W hen it
Dragit
Version: 0.5 Web: https://github.com/ sireliah/dragit F ile sharing
Balla
Version: GIT Web: https://github.com/ TimothyGramnaes/Ball-game C asual browser-based
Command Line Heroes
Version: GIT Web: https://github.com/ CommandLineHeroes/clh-bash H ow many
Pixelorama
Version: 0.8.2 Web: https://github . com/Orama-Interactive/Pixelorama T he
Trash-cli
Version: 0.20.12.26 Web: https:// github.com/andreafrancia/trash-cli A trash can
On the disc
Discover the highlights from this month’s packed DVD!
REVIEWS
Samsung 980 1TB SSD
A strange drive for stranger times, says a perfectly normal  Alan Dexter
Radeon RX 6700 XT
Navi 22 joins the GPU party, trimming core counts, die size and price, as Jarred Walton discovers. If only you could get your hands on it…
Kodachi 8.3
A self-confessed Kodachi fanboy, Mayank Sharma is left speechless by its latest release and doesn’t mind if this review sounds biased (which it is)
Shells.com
Having surrendered most of his existence to the cloud, Mayank Sharma tests a service that might just let him chuck his computer out as well
AlmaLinux OS 8.3
Mayank Sharma is flabbergasted that someone would spend a million dollars to create a community supported clone of a distro
Desperados 3
Management love maverick office types who shoot from the hip, but when Fraser Brown did it they were ducking for cover!
ROUNDUP
Web browsers
Default web browsers are fine, but there’ll come a time when you’ll demand more from your online tools. Shashank Sharma presents five contenders
ESCAPE GOOGLE PHOTOS
Google’s free photo storage is a thing of the past. Jonni Bidwell has some free software to get your albums in order
Free your photos
Whether at home or in the cloud, your photos deserve a new host
Install Nextcloud
Discover how you can tap into the power of Docker Compose to get Nextcloud up and running in a jiffy just like the professionals
Transfer your photos
Now that Nextcloud is installed and operational, it’s time to get your photos into it, and out of reaching distance from Google
Let’s look at Lychee
Get simply beautiful photo hosting with a tropical, fruity aftertaste
IN-DEPTH
OPENSTREETMAP TURNS ONE HUNDRED MILLION!
Google Maps isn’t the only mapping tool on the block. One alternative in particular, OpenStreetMaps, employs an open crowd-sourcing approach, as Mike Bedford reveals
GET INTO GENTOO
Famed as the fastest penguin on the planet, Mats Tage explains how you to can use it to run the fastest of Tux boxes
Pi USER
BITTEN BY THE Pi BUG
Andy Piper is a senior staff developer advocate
Pi 5 confirmed and the Pico’s name
Eben Upton confirms the Pi 5, another Pico and what the model number actually means
AdaFruit ItsyBitsy
Teeny weeny Pico bikini
Plant your Pico
Seeed maker base
Inky Impression
Les Pounder enjoys pop art and eight-bit computers, so this new screen from Pimoroni is an ideal way to display his favourite style of art
Building code for microcontrollers
CIRCUITPYTHON
TUTORIALS
System boot speeds
While Shashank Sharma doesn’t much care for cars that can go 0-60 in six seconds or less, he does expect his distro to boot up in no time at all
Administer servers with your browser
Nick Peers reveals how to use Cockpit to access and manage your headless server remotely – no keyboard or display required
Model and render objects in Blender
We love tea at Linux Format Towers – even that fancy herbal stuff – so Michael Reed is going to show you how to make a lovely cuppa… in Blender
Emulating the Commodore PET
Les Pounder relives a time when a roguish smuggler who looked a lot like Harrison Ford shot first and your computer was ready to code in seconds!
Protecting documents with security tools
Kseniya Fedoruk applies digital signatures, passwords and watermarks, to ensure extra security when working with documents in OnlyOffice
Explore Forth on the Jupiter Ace
Mike Bedford reveals the Jupiter Ace, the contemporary of the Sinclair ZX81 that was programmed in Forth rather than the more popular BASIC
CODING ACADEMY
Coding Zombie Runner with Python
Calvin Robinson creates a custom toolbox for quickly manipulating a custom-built environment, complete with graphical user interface
Collect and graph metrics with Python
PROMETHEUS
Chat
X
Pocketmags Support