# Canonical links and best way to use parameters with url rewriting

I use my own custom routing module in PHP and mod_rewrite. A typical main page URL looks like this:

http://www.example.com/services

There's a large part of the website that displays the products on the site (6000 pages indexed in Google), for which the URLs look like this:

http://www.example.com/products/model/bmw/cat/lubricants

The problem is that in some pages, there are links to the same pages from above that also contain a parameter:

http://www.example.com/products/model/bmw/cat/lubricants/highlight/value

So those URL's have the same content, the second just has a parameter that is used to highlight a certain product.

The problems I have are:

• Google indexed a version of each of the URL's. I don't want visitors to land directly to the version with the highlight parameter, so I don't want those URLs indexed

• In Webmaster Tools, the pages appear with duplicate title (don't know why I don't get a warning about duplicate content/meta/etc too, because they're the same, but..). So this has to be fixed.

I can think of these possible solutions:

1. Use the <link rel="canonical"> when the page is requested with the highlight parameter and point to the one without it. Leave the URLs in the form they are now. Wait for Google to merge them in time.

2. Instead of "rewriting" the highlight parameter (with /), append it the classic way: www.example.com/products/model/bmw/cat/lubricants/?highlight=value, and add highlight in Webmaster Tools to the ignore list of parameters; that way, parameters that don't really change page content would be distinguishable by search engines.

This solution would also shorten the depth a little (as seen by search engines), and I believe it's a good thing from a SEO standpoint.

3. A combination of 1 and 2: canonical links and classic parameters.

Again, should I add the parameter in Webmaster Tools in order to force Google merge the results and not wait for a crawl of those pages?

4. This one is stupid, but: add highlight in Webmaster Tools and keep the URLs as they are, but I don't think it works this way and Google expects only url's in the form ?x=y in order to detect parameters and exclude pages from results.

So, which of these would work best? Is there something else I should do?

There are only 300 results indexed in Google of pages with the parameter. I wouldn't mind to lose them, but a "merge" with the no-parameter pages would pe preferred.

And that mention in Webmaster Tools about duplicate titles somewhat bothers me. Does that affect ranking of those pages (or their no-parameter correspondants)?

-
I'm not entirely sure, so I'll add it as a comment instead of an answer, but I think a combination of 1 and 2 may be the best solution. –  Sherwin Flight May 27 '12 at 6:57

The only other possible solution that springs to mind would be to always link to the canonical URL and use some kind of detection to decide whether to display the highlight. But this depends on what conditions you show the highlight. For example, you could detect the referring URL (such as search?q=value) then highlight what ever matches "value". The above #3 approach is probably easier than this.