site: robots.txt, sitemap, 404 page, canonical links, HSTS - #778
Merged
Merged
Conversation
- Add site/robots.txt and site/sitemap.xml. - Add site/404.html. Cloudflare Pages then returns 404 for unknown paths instead of the home page. - Add a canonical link to each page, and to each generated docs page. The canonical is the extensionless URL that Pages serves with 200. - Set og:url to https://kernelcad.com/. - Redirect /app/connect to https://app.kernelcad.com/connect. The path had no page here and served a copy of the home page. - Add Strict-Transport-Security to site/_headers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes SEO faults on kernelcad.com.
/robots.txtand/sitemap.xmlnow exist. Before, both returned the home page.site/404.htmlmakes Cloudflare Pages return 404 for unknown paths. Before, every unknown path returned the home page with 200.build-docs.ts(test added). Pages servesx.htmlat/x, so the canonical uses/x.og:urlishttps://kernelcad.com/./app/connectredirects (301) tohttps://app.kernelcad.com/connect. This site has no page at that path, so it served a copy of the home page. With the 404 fix it would return 404.max-age=31536000, noincludeSubDomains.robots.txtandsitemap.xmlare real files insite/, so they need no_redirectsline._redirectshas no catch-all rule; the old fallback came from the missing 404 page.The sitemap lists
/,/docs/,/terms,/privacy. The 13 docs pages are generated and linked from/docs/; I did not hard-code them.Not deployed. kernelcad.com deploys from kernelCAD-server
deploy-kernelcad-com.yml.