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
-
Redirect Chain Issues - Cannot Fix
Hi All My Moz Crawl for my domain brings up 7 redirect chain errors. In each case, the original source is our old website. Strangely, only 7 of the pages show up as having redirect chains, as there are many more examples. We have added redirects from the old pages via the redirection tool in wordpress. The redirects themselves are working as expected. The redirects are from the old website, so the address http://www.oursite.co.uk/example.html to https:www.oursite.co.uk/new-page/ The chain seems to go from the original site and address to https and then onto the new domain. Screenshot link to the Moz Report https://imgur.com/a/eXRSFcD Any assistance here would be greatly appreciated. The hosts says there is nothing wrong with the.htaccess file, but I'm thinking this must be the issue. Many Thanks
Technical SEO | | ruislip180 -
Should I keep writing about the same using rel canonical?
Hi, The service we provide has not so many searches per month. A long tail keyword that describes the service well has at the most 400 searches per month. We wrote a post for this keyword and we ranked number 1 for many months. Now we're on page 2 and I the truth is we stopped writing blog posts because we were raking well for our best keywords. I added a few new posts and lost ranking on my top keywords so I gave up, deleted them and recover the rankings for the keywords I wanted the most. The problem is that I have lost these positions and I know we're supposed to be updating the blog regularly. What would you suggest? Should we keep writing about the same thing and use rel canonical? There aren't that many keywords related to what we offer. I appreciate any ideas.
Technical SEO | | Naix0 -
Google displaying "Items 1-9" before the description in the Search Results
We see our pages coming up in Google with the category page/product numbers in front of our descriptions. For example: Items 1 - 24 of 86 (and than the descriptions follows). Our website is magento based. Is there a fix for this that anyone knows of? Is there method of stopping Google from adding this on to the front of our Meta Description?
Technical SEO | | DutchG0 -
My site was hacked and spammy URLs were injected that pointed out. The issue was fixed, but GWT is still reporting more of these links.
Excuse me for posting this here, I wasn't having much luck going through GWT support. We recently moved our eCommerce site to a new server and in the process the site was hacked. Spammy URLs were injected in, all of which were pointing outwards to some spammy eCommerce retail stores. I removed ~4,000 of these links, but more continue to pile in. As you can see, there are now over 20,000 of these links. Note that our server support team does not see these links anywhere. I understand that Google doesn't generally view this as a problem. But is that true given my circumstance? I cannot imagine that 20,000 new, senseless 404's can be healthy for my website. If I can't get a good response here, would anyone know of a direct Google support email or number I can use for this issue?
Technical SEO | | jampaper0 -
What is the difference between "Referring Pages" and "Total Backlinks" [on Ahrefs]?
I always thought they were essentially the same thing myself but appears there may be a difference? Any one care to help me out? Cheers!
Technical SEO | | Webrevolve0 -
Rel Canonical ? please help again!
Hi, I have been looking at the on page section and the grading. And I have noticed on nearly all of my pages an error. No More Than One Canonical URL Tag Moderate fix <dl> <dt>Number of Canonical tags</dt> <dd>2</dd> <dt>Explanation</dt> <dd>The canonical URL tag is meant to be employed only a single time on an individual URL (much like the title element or meta description). To ensure the search engines properly parse the canonical source, employ only a single version of this tag.</dd> <dt>Recommendation</dt> <dd>Remove all but a single canonical URL tag</dd> </dl> <a class="more expanded">Minimize</a> Please how do I make sure these canonicals are working properly, My rankings are getting worst fro long tail and short tail keywords. I am not even ranking for the main keywords "Probate" at all now! Our site is probate, we sell probate, we talk aout probate and now we are out of the top 200??? http://www.finalduties.co.uk Kind Regards Elissa HAyes
Technical SEO | | Chris__Chris0 -
"Too Many On-Page Links" Issue
I'm being docked for too many on page links on every page on the site, and I believe it is because the drop down nav has about 130 links in it. It's because we have a few levels of dropdowns, so you can get to any page from the main page. The site is here - http://www.ibethel.org/ Is what I'm doing just a bad practice and the dropdowns shouldn't give as much information? Or is there something different I should do with the links? Maybe a no-follow on the last tier of dropdown?
Technical SEO | | BethelMedia0 -
Appropriate Use of Rel Canonical
When using the On page report card I get a critical error on Rel Canonical Im not sure if I have understood this right but I think that my problem is that I own a Norwegian Domain name which is www.danske-båten.no This domain works great in norwegian, but I get problems with english (foreign) browsers. My english domain name is http://www.danske-båten.no. When you buy a domain name with the letter Å you get a non norwegian domain name as well. (dont quite get the tecnical aspect of it) Så when I publish a page (using wordpress if that means anything) I get this message: Appropriate Use of Rel Canonical Moderate fix <dl> <dt>Canonical URL</dt> <dd>"http://www.danske-båten.no/ferge-oslo-københavn/"</dd> <dt>Explanation</dt> <dd>If the canonical tag is pointing to a different URL, engines will not count this page as the reference resource and thus, it won't have an opportunity to rank. Make sure you're targeting the right page (if this isn't it, you can reset the target above) and then change the canonical tag to reference that URL.</dd> <dt>Recommendation</dt> <dd>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.</dd> <dd>So What to do to fix this?
Technical SEO | | stlastla
</dd> </dl>0