diff --git a/packages/nuxt/src/app/middleware/manifest-route-rule.ts b/packages/nuxt/src/app/middleware/manifest-route-rule.ts index 30f51c993b..ef3d2e1d37 100644 --- a/packages/nuxt/src/app/middleware/manifest-route-rule.ts +++ b/packages/nuxt/src/app/middleware/manifest-route-rule.ts @@ -1,3 +1,4 @@ +import { hasProtocol } from 'ufo' import { defineNuxtRouteMiddleware } from '../composables/router' import { getRouteRules } from '../composables/manifest' @@ -5,6 +6,10 @@ export default defineNuxtRouteMiddleware(async (to) => { if (import.meta.server || import.meta.test) { return } const rules = await getRouteRules(to.path) if (rules.redirect) { + if (hasProtocol(rules.redirect, { acceptRelative: true })) { + window.location.href = rules.redirect + return false + } return rules.redirect } })