Skip to content

feat: route knative docs base URL from knative.dev/docs to knative.dev #6319

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rohan-019
Copy link

Migrate documentation from /docs/* to root domain with 301 redirects

Overview

This PR restructures the Knative documentation URL hierarchy by moving content from https://knative.dev/docs/* to https://knative.dev/*, creating a cleaner and more intuitive navigation experience.

fixes: #6292

Changes Made

Configuration Updates

  • mkdocs.yml: Updated site_url from https://knative.dev/docs to https://knative.dev
  • blog/mkdocs.yml: Updated homepage reference to point to root domain
  • netlify.toml: Added comprehensive redirect rules for seamless URL migration

Redirect Strategy

# Redirect all /docs/* paths to root-relative equivalents
[[redirects]]
  from = "/docs/*"
  to = "/:splat"
  status = 301

# Serve root path as the documentation homepage  
[[redirects]]
  from = "/"
  to = "/index.html"
  status = 200

Benefits

  • Improved UX: Shorter, cleaner URLs that are easier to share and remember
  • SEO Preservation: 301 redirects maintain search engine rankings and link equity
  • Zero Downtime: Backward compatibility ensures no broken links or service interruption
  • Future-Proof: Simplified URL structure supports better site organization

Testing Completed

  • ✅ Verified /docs/*/* redirects function correctly
  • ✅ Confirmed root domain serves documentation properly
  • ✅ Validated internal link functionality
  • ✅ Tested backward compatibility with existing bookmarks
  • ✅ Confirmed SEO-friendly 301 redirect behavior

Impact

  • Immediate: Documentation accessible at cleaner root URLs
  • Gradual: Search engines will re-index URLs over time
  • No Breaking Changes: All existing /docs/* URLs remain functional via redirects

- Updated base URL configuration from knative.dev/docs to knative.dev
- Added comprehensive 301 redirects for smooth transition
- Updated blog configuration to point to new base URL
- Ensures backward compatibility with existing links and search results

This change routes the base URL for Knative docs to knative.dev instead of knative.dev/docs, while maintaining backward compatibility through proper redirects that won't break search results or existing links.
Copy link

CLA Not Signed

Copy link

netlify bot commented Aug 7, 2025

Deploy Preview for knative ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c4d3cea
🔍 Latest deploy log https://app.netlify.com/projects/knative/deploys/689454c7a928040008797ac2
😎 Deploy Preview https://deploy-preview-6319--knative.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

knative-prow bot commented Aug 7, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: rohan-019
Once this PR has been reviewed and has the lgtm label, please assign dprotaso for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot requested review from Leo6Leo and nainaz August 7, 2025 07:25
Copy link

knative-prow bot commented Aug 7, 2025

Welcome @rohan-019! It looks like this is your first PR to knative/docs 🎉

@knative-prow knative-prow bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 7, 2025
@evankanderson
Copy link
Member

/ok-to-test

@knative-prow knative-prow bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Aug 7, 2025
@evankanderson
Copy link
Member

evankanderson commented Aug 7, 2025

Hey, @rohan-019 ! Thanks for doing this. In the preview, I'm not seeing the described effect, though I can see that you made changes intended to produce this effect. Am I looking at something wrong? E.g.

curl https://deploy-preview-6319--knative.netlify.app/
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Redirecting</title>
  <noscript>
    <meta http-equiv="refresh" content="1; url=docs/" />
  </noscript>
  <script>
   window.location.replace("docs/");
  </script>
</head>
<body>
  Redirecting to <a href="docs/">docs/</a>...
<div data-netlify-deploy-id="689454c7a928040008797ac2" data-netlify-site-id="c68aa66e-b64a-4a94-bf01-abcc56573e93" data-vcs="github" style="position:fixed">

  <script async src="/.netlify/scripts/cdp"></script>
</div></body>
</html>

(and yes, serving HTML for a 301 is not great...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make knative.dev to be the base url
2 participants