diff --git a/lib/index.js b/lib/index.js index d7a8b7f..f4c98bb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -86,7 +86,6 @@ const shouldRedirect = (rewrittenPath, {redirects = [], trailingSlash = null}) = } const defaultType = 301; - console.log(rewrittenPath); if (typeof trailingSlash === 'boolean') { const {ext} = path.parse(rewrittenPath); @@ -100,6 +99,10 @@ const shouldRedirect = (rewrittenPath, {redirects = [], trailingSlash = null}) = target = `${rewrittenPath}/`; } + if (rewrittenPath.indexOf('//') > -1) { + target = rewrittenPath.replace(/\/+/g, '/'); + } + if (target) { return { target,