Using http: shorthand inside canonical tag ("//" instead of "http:") can cause harm?
-
HI,
I am planning to launch a new site, and shortly after to move to HTTPS. to save the need to change over 5,000 canonical tags in pages the webmaster suggested we implement inside the rel canonical "//" instead of the absolute path, would that do any damage or be a problem?
oranges-south-dakota" />
-
I agree,
you should avoid them at all.
-
Hi Peter,
That is true, it appears however the question is if it is okay to use relative paths.
In which Google says:
"...Avoid errors: use absolute paths rather than relative paths with the
rel="canonical"
link element.Use this structure:
https://www.example.com/dresses/green/greendresss.html
Not this structure:/dresses/green/greendress.html
).."REF: https://support.google.com/webmasters/answer/139066?hl=en
I always side on the better to be safe side of things.
Cheers,
Don
-
Don,
this isn't relative path. This is "protocol free". So if domain is blah.com HTTP page will have canonical as http://blah.com and HTTPS page will have canonical as https://blah.com.
-
Hi Po,
No, you can not or should not use "relative" paths in the URL. They are not properly indexed you should use the absolute path.
Ref: Google: https://googlewebmastercentral.blogspot.com/2013/04/5-common-mistakes-with-relcanonical.html
You can use parameters in ASP or PHP to get the path for you.
PHP example: http://stackoverflow.com/questions/6768793/get-the-full-url-in-php
ASP example: http://stackoverflow.com/questions/567590/asp-net-absolute-path-of-a-urlHope this helps,
Don
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
-
Why do two pages compete while a canonical tag is active?
Hi guys, My SERP analysis show me that two pages compete eachother for the keyword kinderfiets, which should not happen since there is a canonical tag is active. www.halfords.nl/fiets/kinderfiets/kinderfiets/ Ranks #6 and www.halfords.nl/fiets/kinderfiets/ Ranks #7. The first one is a subcategory which is one step deeper than the second one. I prefer consumers to land on the broader subcategory, because that one shows more products.Furthermore, we already did some SEO tweaking for the #7 page, but did not work on the #6 page. So it is even kind of strange that this page ranks higher.Can somebody help me out?Kind Regards,Tom
Technical SEO | | Sebastiaan10 -
Google Search Console and User-declared canonical is actually Hreflang tag
Hey, We recently launched a US version of UK based ecommerce website on the us.example.com subdomain. Both websites are on Shopify so canonical tags are handled automatically and we have implemented Hreflang tags across both websites. Suddenly our rankings in the UK have dropped and after looking in search console for the UK site ive found that a lot of pages are now no longer indexed in Google because the User-declared canonical is the Hreflang tag for the US URL. Below is an example https://www.example.com/products/pac-man-arcade-cabinet - is the product page is the canonical tag rel="alternate" href="https://www.example.com/products/pac-man-arcade-cabinet" hreflang="en-gb" /> - UK hreflang tag rel="alternate" href="https://us.example.com/products/pac-man-arcade-cabinet" hreflang="en-us" /> - US Hreflang tag then in Google search console the user-defined canonical is https://us.example.com/products/pac-man-arcade-cabinet but it should be https://www.example.com/products/pac-man-arcade-cabinet The UK website has been assigned to target the United Kingdom in Search Console and the US website has been assigned to target the United States. We also do not have access to robots.txt file unfortunately. Any help or insight would be greatly appreciated.
Technical SEO | | PeterRubber0 -
Can a H1 Tag Have Multiple Spans Within It?
H1 tags on my client's website follow the template [Service] + [Location]. These two have their own span, meaning there are two spans in an H1 tag. class="what">Truck Repair near class="where">California, CA How do crawl bots see this? Is that okay for SEO?
Technical SEO | | kevinpark1910 -
Where can i install my missing title tag?
in the site crawl area is says "missing title tag" and im not sure how to put it in does it go on my website? if so how because i already have a tracking code in the google analytics area
Technical SEO | | raheemah0 -
We just can't figure out the right anchor text to use
We have been trying everything we can with anchor text. We have read here that we should try naturalistic language. Our competitors who are above us in Google search results don't do any of this. They only use their names or a single term like "austin web design". Is what we are doing hurting our listings? We don't have any black hat links. Here's what we are doing now. We are going crazy trying to figure this out. We are afraid to do anything in fear it will damage our position. Bob | pallasart web design | 31 | 1,730 |
Technical SEO | | pallasart
| website by pallasart a texas web design company in austin | 15 | 1,526 |
| website by the austin design company pallasart | 14 | 1,525 |
| created by pallasart a web design company in austin texas | 13 | 1,528 |
| created by an austin web design company pallasart | 12 | 1,499 |
| website by pallasart web design an austin web design company | 12 | 1,389 |
| website by pallasart an austin web design company | 11 | 1,463 |
| pallasart austin web design | 9 | 2,717 |
| website created by pallasart a web design company in austin texas | 9 | 1,369 |
| website by pallasart | 8 | 910 |
| austin web design | 5 | 63 |
| pallasart website design austin |0 -
Rel Canonical tag using Wordpress SEO plugin
Hi team I hope this is the right forum for asking this question. I have a site http://hurunuivillage.com built on Wordpress 3.5.1 using a child theme on Genesis 1.9. We're using Joost's Wordpress SEO plugin and I thought it was configured correctly but the Crawl Diagnostics report has identified an issue with the Rel Canonical tag on the sites pages. I have not edited the plugin settings so am surprised the SEOMoz Crawl has picked up a problem. Example: Page URL is http://hurunuivillage.com/ Tag Value http://hurunuivillage.com/ (exactly the same) Page Authority 39 Linking Root Domains 23 Source Code Considering the popularity of the plugin I'm surprised I have not been able to find tutorials to find what I'm doing wrong or should be doing better. Thanks in advance. Best Nic
Technical SEO | | NicDale0 -
How long to reverse the benefits/problems of a rel=canonical
If this wasn't so serious an issue it would be funny.... Long store cut short, a client had a penalty on their website so they decided to stop using the .com and use the .co.uk instead. They got the .com removed from Google using webmaster tools (it had to be as it was ranking for a trade mark they didn't own and there are legal arguments about it) They launched a brand new website and placed it on both domains with all seo being done on the .co.uk. The web developer was then meant to put the rel=canonical on the .com pointing to the .co.uk (maybe not needed at all thinking about it, if they had deindexed the site anyway). However he managed to rel=canonical from the good .co.,uk to the ,com domain! Maybe I should have noticed it earlier but you shouldn't have to double check others' work! I noticed it today after a good 6 weeks or so. We are having a nightmare to rank the .co.uk for terms which should be pretty easy to rank for given it's a decent domain. Would people say that the rel=canonical back to the .com has harmed the co.uk and is harming with while the tag remains in place? I'm off the opinion that it's basically telling google that the co.uk domain is a copy of the .com so go rank that instead. If so, how quickly after removing this tag would people expect any issues caused by it's placement to vanish? Thanks for any views on this. I've now the fun job of double checking all the coding done by that web developer on other sites!
Technical SEO | | Grumpy_Carl0 -
URL query strings and canonical tag
Hi, I have recently been getting my comparison website redesigned and developed onto wordpress and the site is now 90% complete. Part of the redesign has meant that there are now dynamic urls in the format: http://www.mywebsite.com/10-pounds-productss/?display=cost&value=10 I have other pages similar to this but with different content for the different price ranges and these are linked to from the menus: http://www.mywebsite.com/20-pounds-products/?display=cost&value=20 Now my questions are: 1. I am using Joost's All-in-one SEO plugin and this adds a canonical tag to the page that is pointing to http://www.mywebsite.com/10-pounds-products/ which is the permalink. Is this OK as it is or should i change this to http://www.mywebsite.com/10-pounds-products/?display=cost&value=10 2. Which URL will get indexed, what gets shown as the display URL in the SERPs and what page will users land on? I'm a bit confused so apologies if these seem like silly questions. Thanks
Technical SEO | | bizarro10000