diff --git a/packages/@vuepress/core/lib/node/internal-plugins/routes.js b/packages/@vuepress/core/lib/node/internal-plugins/routes.js index d6cf90b9b1..b3635efb0d 100644 --- a/packages/@vuepress/core/lib/node/internal-plugins/routes.js +++ b/packages/@vuepress/core/lib/node/internal-plugins/routes.js @@ -65,10 +65,12 @@ function routesCode (pages) { }` } - if (regularPath !== pagePath) { + const decodedRegularPath = decodeURIComponent(regularPath) + + if (decodedRegularPath !== pagePath) { code += `, { - path: ${JSON.stringify(regularPath)}, + path: ${JSON.stringify(decodedRegularPath)}, redirect: ${JSON.stringify(pagePath)} }` }