Skip to content

Redirection for /index leads to empty page #4058

Open
@swaldmann

Description

@swaldmann

Describe the bug

Accessing a page via suffixing /index redirects you to the correct page, but no content is displayed. This can be reproduced on vitepress.dev, too: https://vitepress.dev/guide/getting-started/index. A reload afterwards fixes the problem.

In our project we noticed by chance when one of our contributors put an /index suffix on a relative link. Our broken link checker noticed because the request still returns a 404 status code. It's a minor issue but could be handled nicer.

Caveat: this does not seem reproducible during local development.

Reproduction

Open https://vitepress.dev/guide/getting-started/index.

Expected behavior

Either page content is rendered correctly or a 404 is shown.

System Info

System:
  OS: macOS 14.5
  CPU: (12) arm64 Apple M2 Pro
  Memory: 2.68 GB / 32.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 20.13.1 - /usr/local/bin/node
  npm: 10.5.2 - /usr/local/bin/npm
  pnpm: 8.15.6 - ~/Library/pnpm/pnpm
Browsers:
  Chrome: 126.0.6478.128
  Safari: 17.5

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions