Please let me know if I am in a right direction with fixing rel="canonical" issue?
-
While doing my website crawl, I keep getting the message that I have tons of duplicated pages.
http://example.com/index.php and http://www.example.com/index.php are considered to be the duplicates. As I figured out this one: http://example.com/index.php is a canonical page, and I should point out this one: http://www.example.com/index.php to it. Could you please let me know if I will do a right thing if I put this piece of code into my index.php file?
? Or I should use this one: -
This type of duplicate applies to far more than just the homepage...so by implementing a single redirect rule, you handle this type of duplicate for every single URL on your site, and neither people nor search engines will ever see the undesired version.
If you do this via canonical tags, you have to include the canonical tag on every page, which could be very time consuming depending on how large your site is.
-
Thank you, will do!
-
Thanks for your reply, Logan. Why exactly 301 redirect is better than handling this with canonical tags? Canonical tags wouldn't take so much time, would they?
-
As Logan said, you'd be better served handling these with 301 redirects. But you will also want to go in Google Search Console/Webmaster tools into Site Settings and set your preferred domain to either WWW on Non-WWW (depending on which you prefer to show across your site).
-
Hi,
Ideally, you would handle www and nonwww duplication by way of a redirect rule. Both versions of that URL should not render, i.e. when you go to www.example.com it should take you straight over to example.com.
You can handle this with canonical tags the way you've proposed, the URL in the href element should be the one you prefer. However, this should be reserved only as a work-around in the event that you can't get implement a server-side redirect rule to handle ALL www-to-nonwww issues.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
"Yet-to-be-translated" Duplicate Content: is rel='canonical' the answer?
Hi All, We have a partially internationalized site, some pages are translated while others have yet to be translated. Right now, when a page has not yet been translated we add an English-language page at the url https://our-website/:language/page-name and add a bar for users to the top of the page that simply says "Sorry, this page has not yet been translated". This is best for our users, but unfortunately it creates duplicate content, as we re-publish our English-language content a second time under a different url. When we have untranslated (i.e. duplicate) content I believe the best thing we can do is add which points to the English page. However here's my concern: someday we _will_translate/localize these pages, and therefore someday these links will _not _have duplicate content. I'm concerned that a long time of having rel='canonical' on these urls, if we suddenly change this, that these "recently translated, no longer pointing to cannonical='english' pages" will not be indexed properly. Is this a valid concern?
Technical SEO | | VectrLabs0 -
How to fix rel canonical tags?
Hello there, I am trying to fix the issues with my campaign and I am trying to fix Rel canonical issues. I tried to read a few blogs and other sources which talked about the Rel canonical but I am not able to understand why is Rel Canonical happening? I understand that http://elegancealways.com is not the same as http://elegancealways.com/about-us/ but then I cannot change the link as the link is correct. I read about 301 and 302 redirects. I do not understand that which link is correct then? The errors SEO MOZ is showing is what I am not able to understand as these links are correct. I need help here!! Thanks Vineeta qTc2a2H.png
Technical SEO | | vineeta0 -
Should I implement pagination(rel=next, rel=prev) if I have duplicate meta tags?
Hi, I just want to ask if it is necessary to implement pagination(rel=next, rel=prev) to my category pages because Google webmaster tools is telling me that these pages are having similar meta title and meta description. Ex. page1: http://www.site.com/iphone-resellers/1 meta title:Search for iphone resellers in US page2:http://www.site.com/iphone-resellers/2 meta title:Search for iphone resellers in US page3:http://www.site.com/iphone-resellers/3 meta title:Search for iphone resellers in US Thanks in advance. 🙂
Technical SEO | | esiow20130 -
Rel = prev next AND canonical?
I have product category pages that correctly have the prev next but the moz crawl is giving me duplicate content errors. I would not think I also need to have canonical - but do I ?
Technical SEO | | JohnBerger0 -
Cn I use SEOMOZ to find "Bad Links"
We were hit by the Penguin update and I am told it make be because of "Bad Links", but no one can seem to tell me how to find them. We never buy links, and in fact the only links I know about are those from paid affiliates through shareasale - and these affiliates are paid based on performance, not links. 1. Does anyone know how to figure out what links are bad? 2. Once I know, how do I get them to stop linking to my site? Thanks!
Technical SEO | | trophycentraltrophiesandawards0 -
Problem with Rel Canonical
Background: We check to make sure that IF you use canonical URL tags, it points to the right page. If the canonical tag points to a different URL, engines will not count this page as the reference resource and thus, it won't have an opportunity to rank. If you've not made this page the rel=canonical target, change the reference to this URL. NOTE: For pages not employing canonical URL tags, this factor does not apply. Clearly I am doing something wrong here, how do I check my various pages to see where the problem lies and how do I go about fixing it?
Technical SEO | | SallySerfas0 -
Will training videos available on the "members only" section of a site contribute to the sites ranking?
Hello, I got asked a question recently as to whether training videos on the deeper pages of a website (that you can only access if you are a member and log in) will help with the sites ranking. On the SEOMoz software these deeper pages have been crawled as far as I can tell with errors reported on pages from the "members only" section of the site, leading me to believe the members only pages and their content will contribute to the sites overall ranking profile. I have suggested uploading the informational videos on the main pages of the site for now, making them accessible to all visitors and putting them in a more obvious place to encourage more sharing and views, however I've also said I would check it out with some experts so any information will be greatly appreciated! Many thanks 🙂 Charlotte
Technical SEO | | CharlotteWaller0 -
Rel canonical with index follow on query string URLs
Hi guys, Quick question regarding the rel canonical tag. I have lots of links pointing at me with query strings and previously used some code to determine if query strings were in the URL and if they were then not to index that page. If there weren't query strings then the page would be indexed and followed. I assume I can now use the rel canonical tag on each of these pages so the value goes to the proper URL minus any query string. However do I need to have the rel canonical tag above the index, follow tag on the page? So URL is site.com/page.html?ref=ABC meta robots is "index, follow" Rel canonical is "site.com/page.html" Does the order of the meta robots and canonical tag matter? Thanks in advance!
Technical SEO | | panini0