Is the Yoast Homepage Canonical Correct to Include the Trailing Slash?
Attending a conference today I had the pleasure of hearing Joost de Valk of Yoast speak. I use Yoast for all of my clients’ sites and have for years. To say I love this plugin would be an understatement. Some of the guidance I have gotten from Joost through his blog has been invaluable and was one of the first places I learned about SEO. Thanks, bud!
During the Q & A the session, another SEO asked about whether or not it was an issue that the trailing slash is appended to the end of the canonical for the homepage. Basically, his concern was that the canonical seen on the page didn’t match what we see in the browser. He asked if there would ever be a way to control or remove that for just your homepage.
The answer Joost provided I think was basically that Google has said they “get it” either way and are not picky about this situation, and either works.
So there’s that, but how about how browsers really treat URLS?
SEO’s tend to not trust Google, so I can’t fault my colleague for removing the trailing slash for his clients for fear that Google won’t just “get it”. Initially, it made a ton of sense to me actually. Then I remembered something Mike Levin once told me about browsers.
Another part of the answer Joost gave is that it’s dependent on your server configuration, which I think is valid, but I’m not sure of a situation where what I’m about to demonstrate isn’t the case. I checked a number of sites on WP, and not on WP, and on 4 different servers. All were the same.
Here’s the response code returned for WITHOUT trailing slash:
200 Status Code
Now here’s that same site WITH the trailing slash:
200 Status Code
WHAT’S THIS MEAN?
It means both domain.com and domain.com/ return a 200 status code. While other pages DO undergo a 301 when requested without “/”, this is not the case with your homepage. Both “pages” return a 200, with no 301 redirect. Why did I put “pages” in quotes? In this case, unlike the rest of your site, they are not really 2 pages.
In That Case Is the Canonical Yoast Uses “Correct”?
Yup, 100%. In essence, the answer to the question this SEO asked is the canonical in Yoast is the “real” canonical…your browser just isn’t showing it.
Is the SEO in the audience who removes this from his client’s websites wrong? Not really, but maybe.
HERE’S WHY THE YOAST HOMEPAGE CANONICAL IS REALLY CORRECT…NOT JUST KINDA
Because the Hypertext Transfer Protocol says so.
What does this mean? It means that according to the rules of hyperlinks, domain.com is not even a valid request. ONLY domain.com/ is.
In my opinion, you actually DO want that trailing slash in your homepage canonical. Amazon, and Walmart also seem to think so too. Now, these 2 sites have been known to do some pretty dumb SEO stuff, but they also tend to not screw the basics up.
Since the browser defaults to adding that trailing slash, one could argue Google likely does the same in their own assessment of what the canonical version of your homepage is. Remember, if you don’t use canonicals Google will try to pick their own. Why not just line up the crosshairs and be exact? After all the Hyperlink Transfer Protocol says “/” = server root. That means that’s the “homepage” as far as browsers and servers are concerned. Not example.com.
For more information about this, I do not recommend trying to actually read the protocol documents unless you want a headache. This answer below is the best wrap-up of this general concept I have found thus far on Stack Exchange.
Read more on stackexchange.com
Am I wrong somewhere here? Have something to add? Want to send hate mail? Leave it below!