Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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)?

share|improve this question
    
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
add comment

1 Answer

up vote 2 down vote accepted

Yes, I think a combination of canonical URL and classic query string parameters would be the best solution in this case. Google can usually detect duplicate content but sometimes it won't pick the best URL. Using a canonical means that all links to your highlight URL essentially count as a link for the canonical URL.

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.

share|improve this answer
    
Well you are probably right with the referer, and it could be applied for this case. But I asked the question because I wonder about the general use case: should all parameters be "rewritten" so all urls would look beautiful (to Google and to users) or there are cases when parameters shouldn't be conveyed and leave them in the form ?x=y ? How are others doing it? Where do you "stop" with url rewriting? –  talereader May 27 '12 at 14:47
    
And another thought: wouldn't #2 be enough (classic param and adding it to Webmaster Tools) ? Would the canonical link help further? I'm thinking of adding the param in Webmaster Tools with the "No URLs" (meaning "Googlebot should't crawl pages with this parameter"). Would that be risky? Would it have any impact on the "canonical" URLs of the same page (crawl rate, etc)? –  talereader May 27 '12 at 14:58
    
@talereader URL rewriting should in general be used for each unique piece of content or 'entity'. Things like your highlight example that only change parts of a page should be kept to the query string (?x=y). Same goes for sorting, searching/filtering and pagination IMO, as they are in essence showing the same content in a different way. –  DisgruntledGoat May 27 '12 at 23:58
    
And regarding your second comment, it would definitely be beneficial to use a canonical URL to make things perfectly clear for search engines (the parameter tool in GWT is really just a 'guide' for Google). Also other search engines will pick up the canonical too. –  DisgruntledGoat May 28 '12 at 0:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.