diff --git a/src/client/app/router.ts b/src/client/app/router.ts index 8e4af644..09d916ec 100644 --- a/src/client/app/router.ts +++ b/src/client/app/router.ts @@ -159,10 +159,10 @@ export function createRouter( route.path = inBrowser ? pendingPath : withBase(pendingPath) route.component = fallbackComponent ? markRaw(fallbackComponent) : null const relativePath = inBrowser - ? pendingPath + ? route.path .replace(/(^|\/)$/, '$1index') .replace(/(\.html)?$/, '.md') - .replace(/^\//, '') + .slice(siteDataRef.value.base.length) : '404.md' route.data = { ...notFoundPageData, relativePath } syncRouteQueryAndHash(targetLoc)