Skip to content

fix(docs): redirect /gh-aw (no trailing slash) to /gh-aw/#21906

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-no-trailing-slash-404
Mar 20, 2026
Merged

fix(docs): redirect /gh-aw (no trailing slash) to /gh-aw/#21906
pelikhan merged 2 commits intomainfrom
copilot/fix-no-trailing-slash-404

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

GET /gh-aw returned 404 instead of redirecting to /gh-aw/, and the resulting 404 page rendered a doubled canonical URL (https://github.github.com/gh-aw/gh-aw/).

Change

Added trailingSlash: 'always' to docs/astro.config.mjs:

export default defineConfig({
    site: 'https://github.github.com',
    base: '/gh-aw/',
    trailingSlash: 'always',

This instructs Astro to redirect any no-trailing-slash path to its canonical trailing-slash form — covering both the dev server and static build output. Fixes the base path 404 and the bad canonical URL as a consequence (the 404 page is no longer served for /gh-aw). No other pages are affected since all existing links already use trailing slashes.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…thout trailing slash

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f9d37da5-7c36-47ca-9063-bc6382bc4055
Copilot AI changed the title [WIP] Fix no-trailing-slash 404 on base path fix(docs): redirect /gh-aw (no trailing slash) to /gh-aw/ Mar 20, 2026
Copilot AI requested a review from pelikhan March 20, 2026 04:44
@pelikhan pelikhan marked this pull request as ready for review March 20, 2026 04:50
Copilot AI review requested due to automatic review settings March 20, 2026 04:50
@pelikhan pelikhan merged commit d61b1ff into main Mar 20, 2026
60 of 61 checks passed
@pelikhan pelikhan deleted the copilot/fix-no-trailing-slash-404 branch March 20, 2026 04:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Astro docs site configuration to ensure requests to the base path without a trailing slash (e.g., /gh-aw) resolve to the canonical trailing-slash URL (/gh-aw/), avoiding a 404 and incorrect canonical URL rendering.

Changes:

  • Set trailingSlash: 'always' in the Astro config to enforce trailing-slash canonical URLs (and redirect slashless paths).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

export default defineConfig({
site: 'https://github.github.com',
base: '/gh-aw/',
trailingSlash: 'always',
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config change introduces an important routing/redirect behavior but there’s no regression test covering it. Since this repo already runs Playwright against the dev server (see docs/playwright.config.ts), please add a Playwright test that navigates to /gh-aw (no trailing slash) and asserts it redirects/lands on /gh-aw/ (and ideally that it’s not the 404 page / canonical URL is correct). This will prevent the base-path 404 + doubled-canonical regression from reappearing.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🔍 Multi-Device Docs Testing Report - 2026-03-19

3 participants