SEO Bootcamp, Simple URL Rewriting

Of all the search engine optimization techniques out there none is more fundamental than rewriting URLs to be more human and search engine spider friendly. URL rewriting is useful for removing ambiguous querystring parameters that have no meaning to your visitors but are required to drive the content presentation of your data driven website. For example if I were searching for Kung Fu movies and saw the following URLs, http://www.dvdstore.com/categoryid=7 and http://www.dvdstore.com/kungfu-movies.html I would be more likely to follow the second link as I know exactly where I am going, not so with the first ambiguous, albeit functionally identical, URL.

Almost every hosting company in business today supports URL rewriting through Apache’s mod_rewrite functionality, and a lot of the more popular scripts out there such as WordPress have URL rewriting baked in. But if you are building a site from scratch or purchase a custom site URL rewriting may not yet be in effect.

I recently purchased an arcade script site, 2goware.com, and the resulting script provided does not implement URL rewriting. I am going to remedy this. One of the sites implmenting the 2goware.com script is thefastball.com which I also got in the purchase. Currently the script delineates games into 1 of 9 categories and all rolled up into a 10th category. The links for each category, as they exist in version 1.2 of the script, direct the user to index.php?cat=[x] where X is a value between 1 and 9 or “all“. To rewrite these URLs into a more user friendly URLs such as /shooting-games.html requires can be accomplished in about 15 minutes with the use of the .htaccess file. With the 2goware script there was no .htaccess file at all created so I started by creating an empty file named .htaccess. I indicated the start of a new rule by adding the line “RewriteEngine On” (see screen shot at the bottom). Then I added a comment line, preceded by “#” to comment what rule I was implementing (comments aren’t required but they increase readability for the most part.) I then create a RewriteRule for each category that translates the CategoryID into the equivalent Category Name.

www.thefastball.com/index.php?cat=1 becomes www.thefastball.com/anime-games.html
www.thefastball.com/index.php?cat=6 becomes www.thefastball.com/shooting-games.html
etc…

This tutorial is just begins to demonstrate the power of mod_rewrite, I’ll be coming back to mod_rewrite in the future but in the mean time you can read more about it here.

Good luck and I’ll see you in the SERPs!

Popularity: 100% [?]

Post a Comment