diff --git a/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue b/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue index 92818a125c..2c981e6db6 100644 --- a/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue +++ b/packages/@vuepress/theme-default/components/AlgoliaSearchBox.vue @@ -46,7 +46,8 @@ export default { }, algoliaOptions), handleSelected: (input, event, suggestion) => { const { pathname, hash } = new URL(suggestion.url) - this.$router.push(`${pathname}${hash}`) + const routepath = pathname.replace(this.$site.base, '/') + this.$router.push(`${routepath}${hash}`) } } ))