2

Possible Duplicate:
debating between different kinds of URL and see if one is more seo-friendly than other…

Our SEO advisors are claiming that having our URLs in the form:

 www.example.com/category/subcategory/

leads to better ranking in the search engines, etc., but I'm not sure if that's true/valid.

Do others use this practice in their own websites?

The simpler alternative for us would be to do something like:

www.example.com/showcat.php?cat=Category-SubCategory
1
  • This is not quite programming related.
    – Gumbo
    Commented Oct 21, 2010 at 12:45

1 Answer 1

1

Yes, your SEO advisors are correct. You can actually use the Apache Rewrite module to translate that SEO-friendly URL into the alternative you would prefer. By changing the desired URL structure to www.example.com/categories/category/subcategory/, you can do this in your .htaccess file:

RewriteRule ^categories/([^/]+)/([^/]+) showcat.php?cat=$1-$2

Basically when Apache receives the request with the SEO-friendly URL, it matches that line and calls the PHP file using the structure you prefer, automagically inserting the category names.

Almost every PHP CMS with SEO-friendly URLs uses mod_rewrite in some capacity.

Here's a helpful guide to get you started: http://www.addedbytes.com/for-beginners/url-rewriting-for-beginners/

1
  • For more info about mod_rewrite, Google it or check out the links on the right under "Related" :) Commented Oct 21, 2010 at 12:50