diff --git a/lib/redirects/precompile.js b/lib/redirects/precompile.js index 97cd39cacba5..91f57591efbf 100755 --- a/lib/redirects/precompile.js +++ b/lib/redirects/precompile.js @@ -1,4 +1,5 @@ const path = require('path') +const slash = require('slash') const patterns = require('../patterns') const { latest } = require('../enterprise-server-releases') const getOldPathsFromPermalink = require('../redirects/get-old-paths-from-permalink') @@ -85,7 +86,7 @@ module.exports = async function precompileRedirects (pages) { // add a veriation like `/free-pro-team@latest/v3/gists/comments`; // again, we need to do this because all links in content get rewritten if (!developerRoute.startsWith('/enterprise/')) { - const developerRouteWithVersion = path.join(nonEnterpriseDefaultVersion, developerRoute) + const developerRouteWithVersion = slash(path.join(nonEnterpriseDefaultVersion, developerRoute)) const developerRouteWithVersionAndLanguage = `/en/${developerRouteWithVersion}` allRedirects[developerRouteWithVersion] = newPath allRedirects[developerRouteWithVersionAndLanguage] = newPath