Why Your Site Should Use Short URLs

I’ve been to so many sites recently that serve me URLs like this one:


Frankly, I am sick of these kinds of sites. This article digs a bit deeper into why this is bad, and offers solutions for webmasters that do have URLs like the one above.

Why Long URLs Are Bad

Other than the obvious reasons, there are some deeper justifications. Let’s jump right in..


I (and probably many other computer users) are annoyed by long and incomprehensible URLs. Instead, they should look good by being simple and short.


By reading your site’s URLs, I should be able to understand what would happen if I visited that page. This is a bad example of URL readability:


I am able to understand by reading the URL that some sort of action will be performed, but the ?1 gives no clue as to what it is. This is a much better URL:


Now it is perceptible that something will be sent. But still, there is no hint of what will be sent. This is an even-better URL:


The user can now understand that by visiting this URL, mail will be sent.

Memorable URLs

The average person could never memorize a URL like the one at the top of this page—that is what the Clipboard is for. Your URLs need to be short and sweet—short enough so that it is easy to remember.

Now, that doesn’t mean you can’t have URLs that are a bit long. Even when using folders for URLs as in the examples above, these links can get a bit long. But so long as the URL makes sense, it will still be memorable. For instance, this long URL is, well, long—but it is still easy to remember because the link is hierarchically sorted.


Solutions for Shorter URLs

Despite the problematic natures of long, hard-to-remember URLs, they can always be easily shortened. Here are some solutions and methods of doing so.

Send POST Data Instead of GET

For those who don’t know the difference, GET data is included in the URL, while POST data is not visible. By using POST data instead of GET data, the first URL shown in this post could be shortened to:


All of the ugly GET data is now instead being passed via POST, so the URL is much shorter already. But this URL does still not accord to the rule of readability from earlier in this post. Its purpose should be clearly visible, so let’s change the URL.


POST solves a lot of our URL-length problems, but there are still the problems of readability, aesthetics, and memorability.

Use Apache’s .htaccess To Simulate Directories

In the earlier example of memorability, we finished with this URL:


However, the only real folder in this URL should be the /mail folder. The rest of the folders can be simulated with a file called .htaccess, a special type of per-directory configuration file for Apache servers.

In the .htaccess we can redirect that URL to this new, server-readable link.


In this way, we can simply place one index file in the /mail directory to perform the actions.

You might be wondering why I would suggest that URL, as it breaks all the rules of URL readability, aesthetics, and memorability. But actually, this URL is never shown to the user. Although the server is told to serve the above URL, we can make sure the user only sees the clean and short one with our .htaccess file.

This amazingly simple, yet powerful technology is called rewriting. Rewriting requires the mod_rewrite module to be turned on (by default it is enabled). The rewrite module uses regular expressions to match URLs, so this allows the URLs to be very flexible.

Here is an example of an .htaccess file that we could place in the /mail directory, that would perform what was described four paragraphs ago.

# Turn the rewriting engine on
RewriteEngine on
# Should be used
RewriteOptions inherit
# Base directory
RewriteBase /mail/
# Rule for rewriting
RewriteRule ^(.+?)/(.+?)/(.+?)(/|)$ index.php?act=$1&company=$2&person=$3

This is only an example—there are many more things you can do with rewriting.

Don’t Show Filetypes or Filenames

Most non-literate computer users (who are a large portion of the market) will be confused about or forget endings like .php, .html, .htm, and others. It is much better to show folder names instead of specific files. For example, this URL:


Should be changed to this URL.


If you don’t want to create folders for every action, you could just keep search.php and use the .htaccess method mentioned above this to serve search.php when the /search folder is visited.


Thanks for reading! Hopefully these tips will help improve certain (*cough*) websites in the near future.


18 Responses to “Why Your Site Should Use Short URLs”

  1. 1 d March 1, 2008 at 9:26 am

    you should never use POST just to get prettier urls. POST has a very specific functional meaning. it is intended for links that cause permanent actions (making a purchase, updating user data in db) and should not be “passed around” by users. most browsers will warn the user upon resubmitting a POST, for example.

    if you use POST for things like performing a search, you are doing a disservice to your users who might want to pass around links to each other, to show each other search results pages.

  2. 2 Chris February 25, 2011 at 4:32 am

    Totally agree with the guy above.

    Sure, use .htaccess to turn your search variables into folders, but don’t get rid of them!

  3. 4 Winfred August 12, 2013 at 1:07 pm

    U made many outstanding items within ur posting, “Why Your Site Should Use Short URLs | Obsessed with the Press”.

    I will you should be heading back to ur webpage soon enough.
    Thanks ,Abraham

  4. 5 Ashley August 15, 2013 at 3:50 pm

    Thank you so much for applying some time to compose “Why Your Site Should Use
    Short URLs | Obsessed with the Press”. Thanks once more -Wesley

  5. 6 Maryellen August 15, 2013 at 8:37 pm

    I actually have a tendency to agree with pretty much everything that was put into writing
    inside “Why Your Site Should Use Short URLs | Obsessed with the Press”.

    Many thanks for pretty much all the advice.
    Thanks a lot,Jackie

  6. 7 european cars April 6, 2014 at 7:13 am

    Yes! Finally something about Opel Rekord.

  7. 8 quicklink.bz July 11, 2014 at 10:37 pm

    Thanks a lot for sharing this with all folks you actually realize what you are speaking about!
    Bookmarked. Kindly also talk over with my website
    =). We could have a link change agreement between us

  8. 9 http://www.bibliotheekhalle.be/nieuwe-catalogus-toepassing-mijn-bibliotheek/ September 10, 2014 at 9:49 am

    Hey there! Do you use Twitter? I’d like to follow you if
    that would be ok. I’m absolutely enjoying your blog and look forward to new posts.

  9. 10 muscle gain supplement pills October 7, 2014 at 8:53 pm

    Thanks for making the effort to read this,
    you guys rock!

  10. 11 gamescodefree.com January 16, 2015 at 9:45 am

    Peace Games For Kids Easy Minute to Win it workplace games will prove to
    be a terrific team building activity for your corporation. Busyness (keeping yourself and your kids too busy) appears to play a major factor in the insufficient connection kids feel using adults in their
    lives. Frequently , we fault the kids intended for lacking communication skills, saying they are watching too much television set or
    playing too many game titles. In short, don’t let another day
    go by without sharing your hope and wishes for your youngsters and for yourself.
    It’s a secure way to access the Web so a child can independently
    perform and learn online.
    One of the best ways to ensure your kids experience positive effects
    associated with divorce on children is to keep them connected to treasured
    members of the family including uncles, aunts and their
    cousins. It is sensible for both parents to talk to
    the children about the idea of these individuals dating again and to tune in to what the kids have to
    say. Regrettably, I don’t expect that will, given the focus in both events on tax cuts for
    corporations and, among Republicans, on more tax reduces for the rich.
    That the Duggars love children is no shock, but
    the 19 Kids and even Counting” family apparently discover sex as a special
    present, too.
    I loved when my kids came home by daycare
    or school with homemade ornaments and displayed them proudly,
    and had various favorites that we liked for making together.

    For instance I like Quake 3 because it’s market combat but I dislike crime orientated games that show crime pays somehow.

    Games involving physical activities, particularly the
    outdoor ones are among the very effective stress relief games for kids.

    Make the kids sit in a circle and write down their own resolution for the
    coming yr on a piece of paper.
    This sport was never very popular since the EDSAC computer was only available at the University of Cambridge, so
    there was no way to install it and play the idea anywhere
    else (until many years later when an EDSAC emulator
    was developed available, and by that time a number of other excellent video games where obtainable as well…
    The only downside is the loss of a standard headphone plug,
    but that’s a minor quibble when you consider that unlike the greater advanced Nintendo
    DS, typically the GBA SP is also in reverse compatible with the vast catalogue of Game Boy and Game Boy Color game titles.

  11. 12 bastcilk doptb January 27, 2016 at 6:25 am

    I will right away grasp your rss as I can’t to find your email subscription hyperlink or e-newsletter service. Do you’ve any? Kindly allow me recognise in order that I may just subscribe. Thanks.

  12. 13 links February 17, 2016 at 3:17 am

    Great site. Plenty of useful info here. I am sending it to several buddies ans
    also sharing in delicious. And obviously, thanks
    to your sweat!

  13. 14 website June 6, 2017 at 8:08 am

    I was recommended this website by way of my cousin. I am not certain whether or not
    this publish is written by him as no one else recognise such specified approximately my difficulty.
    You are wonderful! Thank you!

  1. 1 social media site Trackback on January 3, 2017 at 1:04 pm
  2. 2 ebay Income Trackback on August 31, 2017 at 8:14 am
  3. 3 how to play pokemon on minecraft Trackback on October 18, 2017 at 6:43 am
  4. 4 traditional news stories Trackback on November 18, 2017 at 10:24 am

Leave a Reply

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

WordPress.com Logo

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

Google+ photo

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

Twitter picture

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

Facebook photo

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


Connecting to %s

Welcome to the blog of a WordPress developer, documenter, tester, and plugin-writer. Find all things WordPress here, and more.

Dagrio D'Ampessi

%d bloggers like this: