I was trying to redirect a /page to https://page.example.com as we're moving around a few things on a static generated Nuxt 3 site.
- routeRules redirect should be the defacto way illustrated quite simply here, but turns out it's a tall order – this doesn't work with static sites, and nor does using redirect inside a /pages/page.vue's script tag.
- I also found a middleware solution, which also works under
yarn dev
but not when the site is generated.
We revert to good old http-equiv="refresh" with the new SEO/meta components of Nuxt.