Visiting `/docs` results `/docs.html` then 404 if `base` is set as `/docs/`
See original GitHub issueDescribe the bug


Reproduction
https://github.com/JounQin/test/tree/vitepress
yarn docs:build --base /docs/ && yarn docs:serve --base /docs/
Expected behavior
http://localhost:8000/docs
(Without ending slash) should work same as http://localhost:8000/docs/
(With ending slash)
System Info
System:
OS: macOS 13.0
CPU: (10) arm64 Apple M1 Max
Memory: 17.64 GB / 64.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.15.1 - ~/Library/Caches/fnm_multishells/3706_1656066380637/bin/node
Yarn: 1.22.19 - ~/Library/Caches/fnm_multishells/3706_1656066380637/bin/yarn
npm: 8.13.1 - ~/Library/Caches/fnm_multishells/3706_1656066380637/bin/npm
Browsers:
Chrome: 103.0.5060.53
Firefox: 101.0.1
Safari: 16.0
npmPackages:
vitepress: ^1.0.0-alpha.4 => 1.0.0-alpha.4
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
Issue Analytics
- State:
- Created a year ago
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Exploring GitLab Pages
This problem most likely results from a missing index.html file in the public directory. If after deploying a Pages site a 404 is...
Read more >404. That's an error. The requested URL was not found on this ...
As you might know, a 404 error is "File not found." This can happen when a file is deleted or there is an...
Read more >Move a Website and Change URL | Google Search Central
Learn how to change the URLs of existing site pages, including domain name changes. Explore moving a website with little impact on search...
Read more >Troubleshoot Cloud Run issues
The following error occurs when you try to deploy or try to call another Google Cloud API: The server has encountered an internal...
Read more >HTTP response status codes - MDN Web Docs - Mozilla
HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped in five classes:
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just to add some color here, VuePress handles this the way to OP is requesting. Leaving out the trailing slash resolves the url to directory
index.html
which does make sense to me - the path should resolve to a usable path which is the trailing slash.This is probably more particularly important for nested documentation pages like
/docs/something/index.md
. When leaving out the trailing slash it resolves to/docs/something.html
which would never be a built path in this case.BTW, the extra
.html
appended to/docs
as/docs.html
on the screenshot happens withcleanUrls: "off"