mod rewrite removing pagination duplicate content

297 views Asked by At

I have a problem with duplicate content...

my links are like this:

  • original: www.example.ro/men-shoes/
  • duplicate: www.example.ro/men-shoes/pagina-1/
  • original www.example.ro/women-shoes/
  • duplicate: www.example.ro/women-shoes/pagina-1/

and other similar pages that has /pagina-1/ at the end

I am not good at mod rewrite.. but i tryed this code

RewriteCond %{QUERY_STRING} ^pagina-1/$
RewriteRule ^(.*) $1 [L,R=301]

it dosen't work... I would be glad to solve this!

thanks!

2

There are 2 answers

0
Jon Lin On BEST ANSWER

Try:

RewriteRule ^(.*)/pagina-1/$ /$1/ [L,R=301]
1
Bob C On

There's no need to use mod_rewrite for this. What you want to use is the rel=canonical tag.

http://support.google.com/webmasters/bin/answer.py?hl=en&answer=139394

This tag is supported by all major search engines.

So, for the two above examples, the following would be in the head of both pages (i.e. in both www.example.ro/men-shoes/ and www.example.ro/men-shoes/pagina-1/)

<link rel="canonical" href="www.example.ro/men-shoes/" />

In essence, this means "assign any link value pointing at the duplicate to the original."

This:

  • stops both appearing in the SERPs
  • assigns any link value from the duplicate to the original
  • does not impose any further mod_rewrite pattern matching overhead.

If the /pagina-1 page is the first paginated page in a product list (I guess it is), you might also want to try using the rel and prev tags.

http://googlewebmastercentral.blogspot.co.uk/2011/09/pagination-with-relnext-and-relprev.html