diff --git a/packages/gatsby-link/src/rewrite-link-path.js b/packages/gatsby-link/src/rewrite-link-path.js index e1b2b496716c7..387deb3c50f60 100644 --- a/packages/gatsby-link/src/rewrite-link-path.js +++ b/packages/gatsby-link/src/rewrite-link-path.js @@ -18,13 +18,14 @@ function applyTrailingSlashOptionOnPathnameOnly(path, option) { } function absolutify(path, current) { + const prefixed = withPrefix(path) // If it's already absolute, return as-is if (isAbsolutePath(path)) { - return path + return prefixed } const option = getGlobalTrailingSlash() - const absolutePath = resolve(path, current) + const absolutePath = resolve(prefixed, current) if (option === `always` || option === `never`) { return applyTrailingSlashOptionOnPathnameOnly(absolutePath, option)