-
Notifications
You must be signed in to change notification settings - Fork 333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Self-Referencing Canonicals? #2722
Comments
Wouldn't this result in relative URLs since SS doesn't know the "canonical domain"? I have doubts if relative canonical-links are valuable. There are modules available handling this. |
The CMS should know its canonical domain, it's what it uses when creating the final URL in |
@michalkleiner AFAIK it does not necessarily know it unambiguously. If multiple domains are living on same vhost without redirection to one single canonical domain, which domain should Director take? If it just takes the current one, it could result in canonical-links with different domains, which is bad and I think it’s against the intention of a canonical link-tag - at least in terms of SEO, but this is why people adding a cannonical-meta-tag after all. |
It takes the same one as it uses to produce the absolute URLs. If there's multiple domains without redirection, and no |
It means for the same Page the canonical link could be different, depending on the domain it is accessed. Search engines 'll likely treat this as duplicate content. But isn't a canonical tag there, to prevent exactly this? If vhost is configured with domainAAA.com & domainBBB.com etc., each variant 'll have a different canonical link, given no |
I'm working on the assumption that one content shouldn't be presented on two or more domains/URLs. If it is on, it is likely treated as duplicate content already, so it needs a redirection, or the canonical domain to be set somehow. IMHO it's not a concern for the link canonical tag. |
2 cents here, but would the vhost issue be outside of the params of this module (or I presume that's something the module could not/should not account for). If the framework is picking up an alternate vhost domain the canonical could be the least of the worries. I could be thinking about this incorrectly, but running a Silverstripe installation for any given domain I would expect any execution to persist the proper domain (within expected env/config params), otherwise wouldn't other areas have issues as well? Again, I may not be thinking about this correctly. |
I do think there is a need for this feature however. There are instances where you may have a form/filter on a page for a list of some kind. An out of the box canonical reduces the work to remember to add one for result actions/pages. It's not a terribly difficult thing to do, but if you have new devs working on a project, it's nice to have that taken care of (and it can be manipulated by an extension if need be). |
Yeah IMO if the exact same content is accessible on multiple domains, that’s a server configuration issue. FWIW we currently already add this ourselves in an extension, but it’s worth bearing in mind that this approach does have issues when you introduce pagination or the “dataobjects-as-pages” approach so we’d need to be careful with the implementation so we don’t introduce SEO issues for people upgrading |
I agree the exact same content should ideally just have one single URL and with a multi-domain setup, best option is to handle redirection on webserver level. But this isn't always the case - for example, many standard setups come with and without www prefix/subdomains and in reality there are unfortunately circumstances for multiple domains. This is exactly where the canonical tag comes in and if set, it has to be ensured there is just one "canonical" version of it on all variants - otherwise it's better to omit it, since it then would add wrong information on top of "duplicated content".
In my view it just should be added, if a canonical domain can be assured (defined per |
The MetaComponents method only adds a canonical if it is a VirtualPage.
Google Recommends to Always Use Self-Referencing Canonicals.
https://hallanalysis.com/2017/07/14/google-recommends-always-use-self-referencing-canonicals/
Would it be better to add it to every page as a Self-Referencing Canonical?
The text was updated successfully, but these errors were encountered: