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

by Scott Allen

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: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • StumbleUpon
  • del.icio.us
  • Sphinn
  • Digg
  • Reddit
  • Netscape
  • Technorati
  • Ma.gnolia
  • YahooMyWeb
  • Slashdot
  • Spurl
  • Fark
  • Furl
  • BlinkList


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


Email This to a Friend Email This to a Friend

Print This Post Print This Post


Related Posts:

  • URL Rewriting - Search Engine Friendly URL’s - Part 2
  • Hyphenated URL’s
  • Choosing the Right Domain Name - Brand vs. Keywords
  • SEO Tip: How to Benefit from Website Scrapers
  • AJAX, Web 2.0 and SEO


  • About This Entry