Creating Effective URLs

Your URL is a cross between your address, your telephone number, and your name. I've previously covered how important it is to choose the correct domain and this advice carries over into how you name your pages and set up your URLs.

When naming your pages it is important to give them meaningful names. Using a URL like http://www.example.com/page4.html or http://www.yoursite.com/article/99/ does nothing for you. Give your pages, or if you run a dynamic site your data identifiers, meaningful names. For instance on this page you'll notice the URL uses a textual identifier of creating_effective_urls to identify the article, rather than an arbitrary number.

If you run a photography site and if you have a page about lenses and a page about film by naming the pages "lenses.html" and "film.html" you are getting one more instance of your main keywords on the page. Your URL is often weighted more than your page content so it is a premium location for inserting keywords. Also, as with domain names, you should separate the keywords with some sort of punctuation. For instance if you have a page about outdoor lenses you should name it "outdoor-lenses.html" as opposed to "outdoorlenses.html." This makes it easier for parsers to pick out your keywords, not all of them will do so without the break. Most places will use an underscore as a parser for keywords, however Google does not, and since Google is the 800 pound gorilla in the search space a hyphen is the way to go.

If you run a dynamic site I realize that this can be quite a job to accomplish, and using true language keys instead of a simple numerical one isn't the most efficient database design, but believe me when I tell you that doing this will be a substantial difference. Not only will it help your search engine rankings, but any links to specific articles or pages on your site from directories will also be ranked substantially higher. This will also make your URLs more people-friendly as it is easier for people to remember URLs with meaningful identifiers than arbitrary numbers.

If you do run a dynamic site there is another issue with your URLs that you need to be aware of, it involves query strings. A query string is a string of information tagged on to the end of a URL following a question mark. For instance in the following URL the query string portion is in bold: http://www.example.com/script.php?id=54&order=desc.

The reason that this is an issue is that some search engines will not index pages with query strings, and not only that but query strings are the easiest and most popular way to pass data to a dynamic page. With the rise in popularity of database driven sites, which were once the domain of big corporations, search engines started to realize that they should be indexing these pages. Since then some, notably Google, have started indexing pages with query strings. However not all search engines do so yet, and to be honest with you from a customer standpoint a standard URL is much easier to remember.

Lucky for you many webmasters have dealt with the problem of passing data without using query strings. From these enterprising individuals come a slew of methods to make your site search engine friendly. What solution you choose will depend on what software or platform you are using, although the Apache web server has the easiest to use features for doing this.

Another way your URLs can hurt you is if you store session information in a URL. Many sites, especially ecommerce sites, track their visitor's sessions. This is usually done with cookies but sometimes it's done by putting session identifiers in your URL. In some cases the session identifiers are only placed in the URL when cookies are not accepted by the client browser. The end result is you have a URL that keeps changing every time your search engine views your site, since they index pages by URL, changing the URL really throws them for a loop and can prevent your site from getting spidered at all. So if you run an ecommerce site, or also a forum, you should definitely be on the lookout for this and avoid it if at all possible. Most often a search engine crawler is specifically detected and then sessions are turned off for that visitor.