diff --git a/src/node/plugin.ts b/src/node/plugin.ts index 439757d26dd2..84e5256f28c4 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -194,7 +194,7 @@ export async function createVitePressPlugin( server.middlewares.use((req, res, next) => { if (req.url) { - const page = req.url.replace(/[?#].*$/, '').slice(1) + const page = req.url.replace(/[?#].*$/, '').slice(site.base.length) req.url = req.url.replace(page, rewrites.inv[page] || page) } next()