How I made my own URL shortener

25 December, 2011 § 2 Comments

Well, this will be a short post (get it?)…

About a month ago, I registered the domain (as well as I set up a simple page on the site that directs users to various webpages/websites about me. I’ve also been using the domain as a URL shortener, but like most lazy developers I chose the simplest and easiest route.

To do so, I uploaded an .htaccess file that does a permanent-redirect to the longer URL. Here is the current state of the file:

redirect 301 /1
redirect 301 /f
redirect 301 /9
redirect 301 /c
redirect 301 /cheevos

To add a new shortened URL, I connect to the server via FTP and append another line.

It’s pretty easy for one person, and it’s nice to have both control over the shortener as well as letting other people know that this is a link from me that can be trusted.


§ 2 Responses to How I made my own URL shortener

  • A.J. says:

    Hey Hey Jared!

    I haven’t made my own URL shortener; but it does sound like a great idea! I’m glad your approach is what you were looking for! I think I might have gone a little more complicated; like PHP:

    That was just a proof of concept — then I would connect to a database and do a lookup of key to URL! I see some advantages such that if you wanted to add another entry/remove one you could have a manage page! Perhaps a statistics page too; but then we are feature creeping! 🙂 Love the post!

  • A.J. says:

    Whoops didn’t have source in sourcecode tags:

    header('HTTP/1.1 301 Moved Permanently');

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

What’s this?

You are currently reading How I made my own URL shortener at JAWS.


%d bloggers like this: