diff --git a/lib/path-utils.js b/lib/path-utils.js index 02e75aab1d26..1dcf9b543304 100644 --- a/lib/path-utils.js +++ b/lib/path-utils.js @@ -71,11 +71,7 @@ function getPathWithLanguage (href, languageCode) { // remove the language from the given HREF // /articles/foo -> /en/articles/foo function getPathWithoutLanguage (href) { - const newHref = href.match(patterns.hasLanguageCode) - ? '/' + href.split('/').slice(2).join('/') - : href - - return slash(newHref) + return slash(href.replace(patterns.hasLanguageCode, '/')) } function getPathWithoutVersion (href) {