cfdocs icon indicating copy to clipboard operation
cfdocs copied to clipboard

No canonical tag

Open GaryStanton opened this issue 6 years ago • 3 comments

I found an issue with the search, whereby entering a / before your search term would result in the browser being redirected outside of the domain. (#872) Whilst playing with this, I noticed that some other characters are filtered out, so if you were to type $£cfimage you'd end up at https://cfdocs.org/$£cfimage - however the content shown would be identical to https://cfdocs.org/cfimage. This is nice, but I noticed there are no canonical tags on the pages and thus search engines might see this as duplicate content. Feasibly someone could publish multiple links to the same page with different URLs, and that might harm the site rankings. Probably not a great deal, and it's unlikely... but still.

I think ideally if the request handler can figure out which content to display, it should issue a 301 redirect to the canonical URL of that content (if the current URL doesn't match the canonical). If not, at least adding a canonical tag would resolve the SEO issue.

GaryStanton avatar Jun 26 '18 23:06 GaryStanton

I didn't get redirected by doing this. Instead I got this js error message:

Uncaught DOMException: Failed to set the 'href' property on 'Location': '//' is not a valid URL.

I agree with the 301 redirect suggestion :+1:

shaedrich avatar Jun 26 '18 23:06 shaedrich

What browser are you using? I get redirected in FF and Chrome. I made a pull request for that though. ;)

GaryStanton avatar Jun 26 '18 23:06 GaryStanton

I am redirected as well when I enter something after the slash, too. I just misunderstood you but got it when I read your pull request ;)

shaedrich avatar Jun 26 '18 23:06 shaedrich