Search Engine Optimization and Dynamic URL’s

I was in a pub in Toronto the other day and a couple of guys sitting next to me started talking about their websites and why Google was having a hard time finding their products. The first man commented that he was using a shopping cart and by knowing what cart he was using, I was able to tell him what his problem was.

It’s actually a pretty common problem when it comes to Google but for none technical people let me explain what a Dynamic URL is and how you can avoid the pitfalls associated with them.

First, what is a URL? Well a URL is a Uniform Resource Locator, in other words the address you see at the top of a web browser. My URL for example is http://www.thisismyurl.com

Now the problem that Google has is that it’s a computer. Possibly a wonderfully clever computer but still a computer. As such it crawls the web looking for new pages and comes across them by indexing the URL and page paths associated with your website.

Second, what is a page path? That’s the physical address of your page in association with your website. For example, if could be /about/ or /contact/. Regardless of what it is, Google looks at it and uses that information as much (or more) than the content on your page.

So with that in mind, if your page path was http://www.thisismyurl.com/store/, Google would assume this was a store. It would add value (or weight) to your site based on this assumption but that’s rarely a good example of your store URL. Most likely, the address to a specific product in your store is something more like http://www.thisismyurl.com/store/product.php?p=72 which tells Google nothing about you or your business.

The site address above is what we call a Dynamic URL, it will change depending upon the product that you’re looking at and while that’s great because it saves a lot of hand coding, it’s tragic for search engines such as Google. Remember, getting your website listed in Google is like a game of Marco Polo where you really want to get caught.

To help Google understand what your product is, we need to get rid of the Dynamic URL by using a Static URL which describes your product. This can be done through a thousand different ways but my personal favorite is by using something called a .htaccess file on your Linux server (that’s where you host your website).

Third, what is a .htaccess file? It’s a special Linux command file which will override the regular behavior of a website at the most advanced level of a web host. We use this file to control aspects of our website beyond basic server interaction.

The contents of each .htaccess file will be different but how it works is basically the same. By placing the following file onto a web server, I will be able to tell Google more about my products and less about the software I use to do it.

  1. Options +FollowSymLinks
  2. RewriteEngine on
  3. RewriteRule store/(.*)-(.*).html$ store/product.php?p=$1

Now, what the guts of the line above are is the statement store/(.*)-(.*).html$ which tells my website to look for any files called from within the store/ directory which include something-something.html. For example, it will now recognize the website address http://www.thisismyurl.com/store/72-Blue+Shoes.html or http://www.thisismyurl.com/store/72-this+is+my+product.html and know that I want to do something special with that information.

What I want to do with it is described in the second part of my statement store/product.php?p=$1. I’m telling the web server to take the first something value (represented by the $1) and query the page store/product.php?p= with the value. Since my value from the earlier example is $1==72, it will return the same result as if I loaded the page http://www.thisismyurl.com/store/product.php?p=72 directly.

Why does this work? Simple. Google is clever but it’s looking for certain things, it wants your website to help it put information in the right places. By describing your product constructively in the URL, you’re assisting Google in cataloging your product while still allowing for dynamic pages.

There are a ton of great tutorials on how to accomplish this now that you know why you want to do it.

3 Responses to “Search Engine Optimization and Dynamic URL’s”

  1. [...] to my blog, please feel free to subscribe to my RSS feed or leave a comment.As I wrote a while back, Web Masters around the world have been using keyword focused website addresses for as long as [...]

  2. [...] display the content better, I’ve also been implementing Nathan’s advice on preparing WordPress for Search Engine Optimization. I’d love your feedback regarding the new design or anything here on thisismyurl.com so [...]

Leave a Reply