Search Engine Friendly URLs and .htaccess / mod_rewrite – Part 1

by Scott Allen - January 14, 2006 
Filed Under .htaccess, SEO, URL Rewriting

A common topic in search engine optimization these days is the conflict between search engines and dynamic sites. There is an ongoing battle between “user-friendly” and “search engine friendly”. A LOT of the time, search engines don’t like sites that users do. (This is ironic, because they are always touting the need for user-friendliness.) It is true that often search engines don’t like sites that are well-designed (”Too graphic-heavy!”), that are dynamically coded-such as Amazon.com, Flash, etc. Now, they can learn to like these sites, but it takes extra work on our end, as web designers. It’s up to us to go the extra mile.

Right now I’m only going to talk about Search Engine Friendly URL’s and dynamic web sites. Most search engines have a hard time with dynamic urls…you can spot them because they end in “.php?id1=value1&id2=value2&id3=value3″ and such. Now these are often necessary to handle complex operations with dynamic sites. Google will in many cases strip the query strings and Session ID’s off and only index the first page, which drastically alters the function of the site, rendering incorrect content to the user. Sometimes it leaves them intact and indexes them as-is. (UPDATE 01/15/07: Google claims that this is no longer a problem, but we’ll see.) Other search engines are wildcards as well. Well, we just happen to have a couple tricks up our sleeves to MAKE them function properly.

First, we need to get the server to rewrite the URL to transform it from an ugly URL to a friendly one. We need some kind of rewrite engine, whether simple or complex. A rewrite engine is a piece of web server software used to modify URLs, for a variety of purposes. The Apache HTTP server (usually on UNIX or some variation) has a rewrite engine called mod_rewrite, which is very powerful in URL manipulation.

There is a config file these servers called .htaccess that lets you perform a whole variety of custom URL manipulations. I plan on going a lot more in depth, but I’m going to stop here for now, and pick up this thread in a later post.

To be continued…but for now, check out the following articles:

One of the other tricks, which I’ll go into more later as well, is to have your site detect which search engine spider is visiting your site, and have your site alter how it handles the dynamic processing (different from cloaking, which is unethical).

Technorati Tags:
| | | | | | | | | |

Bookmark, Share and Enjoy:
  • Twitter
  • Sphinn
  • StumbleUpon
  • Facebook
  • del.icio.us
  • LinkedIn
  • Google Bookmarks
  • E-mail this story to a friend!
  • Print this article!


If you enjoyed this post, make sure you subscribe to the RSS feed!

Related Posts:

  1. URL Rewriting – Search Engine Friendly URL’s – Part 2
  2. .Htaccess Reference
  3. Duplicate Content Prevention: WWW vs. Non-WWW and .Htaccess
  4. Search Engine Optimization (SEO) Tools #2 – Robots.txt Generator
  5. Search Engine Optimization (SEO) Tools #1 – Check Your Rankings



Comments

2 Responses to “Search Engine Friendly URLs and .htaccess / mod_rewrite – Part 1”

  1. Carter Mason on January 15th, 2006 11:00 pm

    Scott -

    This is great info for people using dynamic content sites.

    For those considering Content Management Systems, I’d suggest researching which ones already have quality search engine friendly URL components available. Joomla! I know has excellent resources for this.

  2. URL Rewriting - Search Engine Friendly URL’s - Part 2 | WebGeek on September 9th, 2006 2:00 pm

    [...] More to come. For more info, read my previous post on URL rewriting and search engine friendly url’s. [...]

Leave a Reply
If you have any questions about commenting, please see our Comment Policy.