Skip to content
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

Relative canonical reported as invalid #12463

Closed
wasshuber opened this issue May 11, 2021 · 10 comments · Fixed by #12676
Closed

Relative canonical reported as invalid #12463

wasshuber opened this issue May 11, 2021 · 10 comments · Fixed by #12676

Comments

@wasshuber
Copy link

wasshuber commented May 11, 2021

Provide the steps to reproduce

  1. Run LH on https://www.lybrary.com/the-royal-road-to-card-magic-p-35.html

What is the current behavior?

Reports canonical URL to be invalid because it is a relative URL.

What is the expected behavior?

The page defines a base URL with the <base> tag. This together with a relative URL in the <link rel=canonincal> tag defines unambiguously a complete/absolute URL as the canonical URL. This should not create an invalid response. It is completely standard conformant. The Google crawler correctly picks up this canonical URL without any issues.

Environment Information

  • Affected Channels: DevTools
  • Lighthouse version:
  • Chrome version: 90.0.4430.93 (Official Build) (64-bit)
  • Node.js version:
  • Operating System:

Related issues

@patrickhulce
Copy link
Collaborator

Thanks for filing @wasshuber! Please see #12149 and the Google Search documentation on this subject. This audit isn't about what can work, it's about SEO best practices. If that's not a concern this site has, feel free to ignore this result then.

@wasshuber
Copy link
Author

Thanks for the info. I guess my main problem here is the wording 'invalid'. 'Invalid' suggests that some syntax rule or official standard has been violated, which is not the case. Perhaps it should be called 'not recommended'.

@patrickhulce
Copy link
Collaborator

Yes, good point. Anyone watching interested in a good first bug to add "not recommended" to

explanationRelative: 'Relative URL ({url})',
?
:)

@techguysid
Copy link

techguysid commented May 14, 2021

@patrickhulce I think I can take this up. Let me know if I should.

@patrickhulce
Copy link
Collaborator

sure @techguysid go for it! :)

@techguysid
Copy link

techguysid commented May 14, 2021

@patrickhulce - Thanks! Do you want me to replace invalid explanationInvalid: 'Invalid URL ({url})' to explanationNotRecommended: 'URL ({url}) not recommended' or add a new entry for it ?

@techguysid
Copy link

Because we would still be using explanationInvalid: 'Invalid URL ({url})' for some other cases if not this right? So I think adding new entry will help. Just wanted to double check.

@patrickhulce
Copy link
Collaborator

No, invalid URLs are still invalid. We're only tweaking the relative URL description to say it's not recommended

@techguysid
Copy link

techguysid commented May 14, 2021

Oh ok! explanationRelative: 'Relative URL ({url})' should have a not recommended thingy, something like explanationRelative: 'Relative URL ({url}) (not recommended)',

@techguysid
Copy link

@patrickhulce Here's the PR: #12479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants