Yes you are correctly specifying the canonical link for each time the page is hit.
That’s what it is intended for (google discusses it here). So that whatever URLs people are using to generate this page, you are telling Google that the official link for this content is http://www.ladydecosmetic.com/makeup-kits-cat-67
. I think it’s reasonable to suspect this is the proper action to help prevent Google from reducing your score because of duplicate content, since this is the official solution they give.
Additionally (as google discusses here), you can also add a rule in an .htaccess
file to perform a 301 redirect and inform Google that any of these links are not valid and to redirect to the correct link. This may help if those improper versions of your links are heavily indexed and high in the search rankings.
In your .htaccess file:
RewriteEngine On
RewriteRule ^makeup-kits-cat-67&category_id=7$&colors=blue,red([A-Za-z0-9-.'=&+/]+)$ makeup-kits-cat-67&category_id=7$&colors=blue,red [R=301,L,NC]
(Note: this is assuming a ?
was not used when users added on the &blah=blah
to the URL, otherwise it’s treated as a query string and it’s unnecessary to strip these)
solved Dynamic Url & Canonical meta tag issue [closed]