D
D
Den Belzarayn2016-07-05 11:50:24
PHP
Den Belzarayn, 2016-07-05 11:50:24

Eliminate duplicate site pages using robots and htaccess?

Such a problem was attached to a static site by comments and, by analogy with tree-like comments in WordPress, a double is created with each comment. I noticed this late and about a dozen duplicates got into the search, I read that the standard in robots does not solve the problem for Google.
I will describe the problem in more detail, here is the page sitemy.com/stares1
When a comment is created, it is added to the above example sitemy.com/stares1?id=9884774346734463.82
I wrote this in robots.txt:
Disallow: /*?id=*
Disallow: /*? id=
Disallow: /*?*
Disallow: /*?
And in htaccess line:
RewriteRule (.+)/?id= /$1 [R=301,L]
Can you tell me if I did something wrong? Maybe something needs to be added?
Do you need to carry out any other manipulations so that duplicates disappear from the index?
There are no duplicates in Yandex, but in Google there are and read articles that you can’t just remove duplicates.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Romanov, 2016-07-05
@Serhioromano

I would just add the canonical meta tag to the page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question