Skip to content

serve: with base: '/docs/', should /docs work as /docs/? #8770

@JounQin

Description

@JounQin

Describe the bug

When run with vitepress dev docs --base /docs/ and visit /docs route, it will be response with a message:

The server is configured with a public base URL of /docs/ - did you mean to visit [/docs/docs](http://localhost:3000/docs/docs) instead?

I would expect /docs render same as /docs/ or just redirect to /docs/ instead.

Related vuejs/vitepress#852

Reproduction

https://github.com/JounQin/test/tree/vitepress

System Info

System:
    OS: macOS 13.0
    CPU: (10) arm64 Apple M1 Max
    Memory: 20.53 GB / 64.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.15.1 - ~/Library/Caches/fnm_multishells/50102_1656090482477/bin/node
    Yarn: 1.22.19 - ~/Library/Caches/fnm_multishells/50102_1656090482477/bin/yarn
    npm: 8.13.1 - ~/Library/Caches/fnm_multishells/50102_1656090482477/bin/npm
  Browsers:
    Chrome: 103.0.5060.53
    Firefox: 101.0.1
    Safari: 16.0
  npmPackages:
    @vitejs/plugin-react: ^1.3.2 => 1.3.2 
    vite: ^2.9.12 => 2.9.12

Used Package Manager

yarn

Logs

N/A

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p2-nice-to-haveNot breaking anything but nice to have (priority)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions