Why do web app developers make URLs so hard to remember?!?

Rewriting for Fun

Over the course of the past few weeks I've sent out a link to our personal Gallery installation to share pictures of our new son many times. Now I love Gallery and even though I can recite PI to 42 significant digits, I can't recall the exact URL to the album containing his pictures. I'm constantly looking it up and cutting and pasting it into my e-mail and quite frankly, it's getting annoying. It's long and confusing and not easily remembered.

I can't rewrite Gallery to generate easier to remember URLs - at least not in the time I have available right now - and I really don't want to start mucking with Apache's mod_rewrite. So what's a tired mom to do? Well, this mom is going to write an iRule to create what is commonly known in the vernacular as a vanity URL. Basically, the iRule needs to rewrite a simple, easy to remember URL to the appropriate Gallery URL so I can stop wasting type with looking up the actual URL.

when HTTP_REQUEST {
   if { [HTTP::uri] starts_with "/Nathaniel" } {
      HTTP::uri "/main.php?g2_view=core.ShowItem&g2_itemId=35937" 
   }
}

There, that's it. Now I can easily remember the URI and never have to worry about cutting and pasting the actual URI again. Now you might be thinking that's nice, but you don't need to implement vanity URIs so this is useless. Not so fast...

Rewriting for Profit

Rewriting URIs is useful for many, many situations. Landing pages, for example, are commonly used to track marketing and advertising campaigns and are heavily used in SEO (Search Engine Optimization).  A rewrite on the BIG-IP via iRules makes creating - and tracking - those URIs a breeze. Changes in applications can easily be handled by using a URI rewrite iRule, as well as just simply dealing with the strange and difficult to remember URIs that are often automatically generated by application servers or third-party applications.

Specialized URIs can also be useful for tracking where users are coming from - did they get the URL from a magazine ad, or via TV, an e-mail or a specific web-page or blog? Using unique URIs lets business owners understand how users are being referred to your site without asking the user for that information. Not only can you skip asking the user, you're assured that the data is far more accurate.

Hosting companies can use a URI rewrite rule for multiple purposes such as masking custom directory structures or application paths or even just rewriting a vanity host name. If you pair iRule capabilities with iControl, you can even implement the creation of these rewrites in real-time so your customers can do the work for you.

It's also more efficient and offers better performance overall to rewrite a URL rather than use a standard HTTP redirect. With an HTTP redirect the client receives the new URL and must make a second connection while when using an iRule to rewrite the URI this second connection is not necessary because the BIG-IP handles the rewrite transparently.

There are literally hundreds of reasons you might want to rewrite a URI and using iRules to do the job just makes life a whole lot easier.

Imbibing: Coffee

Technorati tags: , , ,