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
serve
: with base: '/docs/'
, should /docs
work as /docs/
?
#8770
Comments
base: '/docs'/
, should /docs
work as /docs/
?serve
: with base: '/docs'/
, should /docs
work as /docs/
?
serve
: with base: '/docs'/
, should /docs
work as /docs/
?serve
: with base: '/docs/'
, should /docs
work as /docs/
?
I think this is expected. That said, IMHO changing the message to below would be friendly. did you mean to visit [/docs/docs](http://localhost:3000/docs/docs) or [/docs/](http://localhost:3000/docs/) instead? |
We now consider `` same as |
In URL spec, new URL('http://localhost:3000').href === new URL('http://localhost:3000/').href // true
new URL('http://localhost:3000/docs').href === new URL('http://localhost:3000/docs/').href // false https://url.spec.whatwg.org/#url-equivalence Vite is not doing something special here. |
As a user it is very common to visit |
It is a server configuration issue, if you want to have this behavior, add a server middleware to do a redirection or forwarding, maybe we can add an option to enable it in the dev server and also in the preview. I configure my production servers when using some |
I understand that but it is confusing if Maybe it is not confusing if the redirect works after some seconds like |
Right, that's why it should 'fixed' in |
My fix is just doing a redirect from
It's still meaningless for an end user to understand the difference between |
I believe that option is not very helpful? When would an end user expect |
I think it is not completely meaningless but I agree that a user does not need to care about it usually. |
@sapphi-red I've just rebased #8772, please help to review, it should fix |
I also encountered the same problem, after changing 'base', many links still can't be added... |
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Closes vitejs/vite#9236 Closes vitejs/vite#8770 Closes vitejs/vite#8772
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com> Closes vitejs/vite#9236 Closes vitejs/vite#8770 Closes vitejs/vite#8772
Describe the bug
When run with
vitepress dev docs --base /docs/
and visit/docs
route, it will be response with a message: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
Used Package Manager
yarn
Logs
N/A
Validations
The text was updated successfully, but these errors were encountered: