Dynamic Url & Canonical meta tag issue [closed]

2019-09-23 04:48发布

问题:

http://www.ladydecosmetic.com/makeup-kits-cat-67

This is one of my site url , it is dynamic, various parameters are attaching with this url on filtration like, http://www.ladydecosmetic.com/makeup-kits-cat-67&category_id=7&colors=blue,red

I have set canonical meta as link href="http://www.ladydecosmetic.com/makeup-kits-cat-67" rel="canonical" to point to the real url.

But the issue is some one are doing posting ugly urls like adding &blahblah=blah, still it is working.

How this will affect my SEO ? this ugly url also giving same content.

I can do a thing like filter my valid parameters and if invalid are found then 404 redirect but this need additional work and some more load on server. Or is it ok, as I given canonical meta ?

Thanks

回答1:

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)



标签: seo