A general warning about Query String rewriting and SEO

Several people have in the last few months asked for help with code that parses a URL into a query, like this.

/www.site.com/param/val/param2/val/param3/val

As I understand it this is getting done in the hopes of making URI’s nice and pretty for SEO purposes. It’s also a great way to lose page rank. Here’s why.

First, search engines have no problem parsing query strings. However, query strings aren’t seperate pages. Hence

index.php?page=home
index.php?page=news
index.php?page=about

These are all considered the same page by a search engine, so url rewriting to separate them is advised. The problem is overkill like this.

category/tshirts/size/m/color/blue/brand/jacki

In a shopping cart system we can expect to see this sort of thing. The danger is if the parameter order gets switched.

category/tshirts/color/blue/size/m/brand/jacki
category/tshirts/brand/jacki/color/blue/size/m

And so on. Each of these sequences are considered separate pages. When the search engine realizes they are the same page it lowers the ranking of the page for spam.

When using mod rewrite to allow query strings to be set up in this manner, keep in mind that you must choose an order for the parameters and enforce it to avoid the illusion of duplicate pages and being penalized. And don’t be afraid to use query strings. Google knows that

category/tshirts.php?color=blue&size=m&brand=jacki
category/tshirts.php?brand=jacki&color=blue&size=m

are the same page, just with different search parameters, and won’t penalize you.

Thanks for the insight!

The solution I use is simply a mix of the two.

For example.

/cart/add?p=black-shirt&o=red

For most pages, it would simply be something like /products, or /contact-us, but to pass parameters in, you’d use the normal query string.

What michael presents is a very annoying situation where you must follow an exact order and deviations can cause issues due to the coupling of the URI as a request and as a parameter.

why is this in the php forum?

i think it belongs elsewhere, as it has much broader scope

I’m not against moving it, but I posted it here because typically PHP is used with mod_rewrite to perform these sorts of operations and the topic has come up frequently enough in the past 3 months I figured it warranted comment.

I wish there were like button here as in facebook. lol (I would have liked this thought)

Thread moved to the Server Configuration, Apache & URL Rewriting forum.

If your using Apache then you can do re-writes using .htaccess once the rewrite module is enabled by un-commenting the line LoadModule rewrite_module modules/mod_rewrite.so httpd.conf and rebooting once the change has been saved.

MM,

Your argument if fallacious. When using the path method and redirecting WITHOUT an R=301, the actual script is hidden from the visitor (which includes SE’s). When you post something like this, please understand what you’re posting so newbies will not get the wrong impression.

If you doubt me, go to http://wilderness-wally.com and tell me which script is serving all the @#$% articles on the website.

Regards,

DK

The content the script outputs however is NOT so hidden, and if the content matches, or nearly matches, the output of the script for another “page” on the same site, the spider will declare it a spam dupe and lower the page rank of BOTH pages.

When you post something like this, please understand what you’re posting so newbies will not get the wrong impression.

I do understand what I’m talking about and you sir are the one in error. Lower your bombast please.