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
-
How google bot see's two the same rel canonicals?
Hi, I have a website where all the original URL's have a rel canonical back to themselves. This is kinda like a fail safe mode. It is because if a parameter occurs, then the URL with the parameter will have a canonical back to the original URL. For example this url: https://www.example.com/something/page/1/ has this canonical: https://www.example.com/something/page/1/ which is the same since it's an original URL This url https://www.example.com/something/page/1/?parameter has this canonical https://www.example.com/something/page/1/ like i said before, parameters have a rel canonical back to their original url's. SO: https://www.example.com/something/page/1/?parameter and this https://www.example.com/something/page/1/ both have the same canonical which is this https://www.example.com/something/page/1/ Im telling you all that because when roger bot tried to crawl my website, it gave back duplicates. This happened because it was reading the canonical (https://www.example.com/something/page/1/) of the original url (https://www.example.com/something/page/1/) and the canonical (https://www.example.com/something/page/1/) of the url with the parameter (https://www.example.com/something/page/1/?parameter) and saw that both were point to the same canonical (https://www.example.com/something/page/1/)... So, i would like to know if google bot treats canonicals the same way. Because if it does then im full of duplicates 😄 thanks.
Technical SEO | | dos06590 -
Are links still considered reciprocal if the link from one website is rel="nofollow" and the other isnt ?
Im working on a site that has some press coverage due in the next couple of days from quite a big site in the niche. The press outlet has requested that we link back to the content they post about us, they said the link can be rel="nofollow" if we'd prefer. Id really like to get the full benefit of the link back to our website, obviously if i did a straight link back to the 3rd party press site the links would be reciprocal and cancel each other out in terms of "link juice", but i was wandering if we make our link back to the 3rd party rel="nofollow" will we still get the full benefit of their link to us in terms of link juice ? ie. having the link back to them, but nofollow wouldn't been seen as a reciprocal link. ? (Obviously either way there is still benefit of having the link even if it reciprocal as it will send traffic to our site, but just no "link juice") Note - Ive used the phrase"Link Juice" for lack of a better term, any ideas on how else to refer to this ?
Technical SEO | | Sam-P1 -
Is this an ideal rel=canonical situation?
Hey Moz community, Thanks for taking time to answer my question. I'm working directly with a hospital that has several locations across the country. They've copied the same content over to each of their websites. Could I point the search engines back to a singular location (URL) using the rel=canonical tag? In addition, does the rel=canonical tag affect the search engine rankings of the URLs (about 13 of them) that use the rel=canonical tag? If I'm on track, is there an ideal URL (location) to decide has the original content? This is actually the first time I've ever needed to use rel=canonical (if applicable). Thanks so much. Cole
Technical SEO | | ColeLusby0 -
Forum website rel="nofollow" is this Good?
Hi, Forum website rel="nofollow" is this Good? We have a Q & A site and have all links as Nofollow. Would this be a good way? Thanks
Technical SEO | | mtthompsons0 -
Same URL in "Duplicate Content" and "Blocked by robots.txt"?
How can the same URL show up in Seomoz Crawl Diagnostics "Most common errors and warnings" in both the "Duplicate Content"-list and the "Blocked by robots.txt"-list? Shouldnt the latter exclude it from the first list?
Technical SEO | | alsvik0 -
404 crawl errors from "tel:" link?
I am seeing thousands of 404 errors. Each of the urls is like this: abc.com/abc123/tel:1231231234 Everything is normal about that url except the "/tel:1231231234" these urls are bad with the tel: extension, they are good without it. The only place I can find this character string is on each page we have this code which is used for Iphones and such. What are we doing wrong? Code: Phone: <a href="[tel:1231231234](tel:7858411943)"> (123) 123-1234a>
Technical SEO | | EugeneF0 -
Rel Canonical problem or SEOmoz bug ?
Hello all, I hope that sombody out there could help me with my question. I am very new in SEO and in SEOmoz community. I am not familiar with coding. I am goining to start learning soon enough but till now I now only basics. At the website where I am trying to optimize for SEO I am reciving this Crawl Diagnostic Programme. Issue: Rel Canonical (Notice) not Error I searched and lerned what it is. So I contact the developers of the website. Build in wordpress and ask them how to corrected ? They told me that they are using Canonical Tags to all their pages and have no idea why SEOmoz keep identifining it as a "notice" They also tel me to check the source code of page to see the canonical tag. I did and their is actuall a canonical tag there. Cjeck please here www.costanavarinogolf.com So do you have any idea why this is happening ? could you help me explaiin to developers what they should do to overcome this ? Or it's just a bug of SEOmoz and not a reall problem exist ? Thank you very much for your time
Technical SEO | | grzontan0 -
On-Page Report Card, rel canonical
My site has the rel canonical tags set up for it. The developers say that it is set up correctly. Looking at the source code myself, it looks (to my untutored eyes) to be set up correctly. However, on the On Page Report Card for every page I have checked, it says that it doesn't point to the right page. I'd really like to change all my 'B's to 'A's, but I simply can't see what the issue is.
Technical SEO | | Breakout0