diff --git a/src/runtime/nitro/middleware/redirect.ts b/src/runtime/nitro/middleware/redirect.ts index 89482a74..b1c70a32 100644 --- a/src/runtime/nitro/middleware/redirect.ts +++ b/src/runtime/nitro/middleware/redirect.ts @@ -4,12 +4,12 @@ import { useNitroOrigin, useSiteConfig } from '#imports' export default defineEventHandler((e) => { const siteConfig = useSiteConfig(e) - if (siteConfig.site) { - const siteConfigHostName = new URL(e.path, siteConfig.site).hostname + if (siteConfig.url) { + const siteConfigHostName = new URL(e.path, siteConfig.url).hostname const origin = useNitroOrigin(e) const originHostname = new URL(e.path, origin).hostname // if origin doesn't match site, do a redirect if (originHostname !== siteConfigHostName) - return sendRedirect(e, joinURL(siteConfig.site, e.path), 301) + return sendRedirect(e, joinURL(siteConfig.url, e.path), 301) } })