Free auditStart free
GuideNuxt · URL migrations

Nuxt redirects

Configure Nuxt routeRules redirects, choose the right status, and test the production response across your rendering and hosting setup.

3 min
read
4
sources
Oct 24, 2026
updated
Scaplet Editorial Team
author
In one line

Define known URL moves in Nuxt's routeRules and set an explicit status code: 301 or 308 for a permanent move, 302 or 307 for a temporary one. Nitro and static hosts handle rules differently, so request the deployed old URL and verify its HTTP status and Location header.

30-second check

Where does your site stand?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
01Checklist

Add an explicit server route rule

Nuxt route rules are configured in nuxt.config.ts and applied by Nitro to matching routes. The redirect rule accepts a destination and a status code. Nitro documents that a string value such as redirect: '/new-page' uses 307 (Temporary Redirect), so set the code explicitly for a permanent move. Nuxt's configuration reference marks routeRules as experimental, so recheck the behavior after Nuxt upgrades.
  1. 01Choose a permanent status for a permanent move and point directly to the final canonical URL.
  2. 02Keep temporary redirects temporary while a migration is being tested or when the source page will return.
  3. 03Avoid redirect loops and chains. Update internal links, canonicals, and sitemap entries to point at the destination instead of relying on the old URL forever.
  4. 04Nitro route rules also accept a wildcard, for example '/old-page/**': { redirect: '/new-page/**' }. Use exact route mappings for a manageable set of URLs. For broad or data-driven migrations, generate rules from a reviewed mapping or use redirect support at the CDN or host.
nuxt.config.ts
export default defineNuxtConfig({
  routeRules: {
    '/old-product': {
      redirect: { to: '/products/current', statusCode: 301 }
    },
    '/preview-path': {
      redirect: { to: '/new-preview', statusCode: 302 }
    }
  }
})
02How it works

Test the rendered deployment, not only the config

  1. 1

    Build with the production preset

    Use the same Nuxt/Nitro preset and adapter as production. A route rule may be handled differently by a server runtime, prerendered output, or static host.

  2. 2

    Request the source URL

    Inspect the old URL's HTTP status and Location header with a GET request. A client-side route transition can look correct in a browser while the first HTTP response still serves the old route.

  3. 3

    Follow the destination

    Confirm the destination returns the intended page, remains on the canonical host, and does not redirect again. Test query strings, trailing slashes, and any important encoded paths.

  4. 4

    Check key page types

    For a dynamic route, test representative product or article slugs, not just one hard-coded example. Verify no matching Nuxt page or catch-all route is taking precedence unexpectedly.

03Choose redirect behavior by the change

Preserve search and visitor signals during a move

Situation

A page has permanently moved to its close replacement

Use
Permanent server-side 301 or 308
Follow-up
Update internal links, canonical, and sitemap to the destination
Situation

A URL move is temporary or under a test

Use
Temporary 302 or 307
Follow-up
Keep the original available when the test ends and remove temporary rules promptly
Situation

There is no relevant replacement

Use
Return an honest 404 or 410
Follow-up
Do not send unrelated URLs to the home page; preserve a useful not-found response

Google lists 301 and 308 as permanent redirects and 302, 303, and 307 as temporary ones, and says a server-side redirect has the highest chance of being interpreted correctly. See Nuxt's routeRules configuration, Google's redirect guidance, and our redirect chains diagnostic.

Questions

Asked a lot.

3 questions people ask next, answered from the sources on this page.

01How do I make a 301 redirect in Nuxt?

Add a route rule in nuxt.config.ts with a destination and explicit statusCode: 301, then deploy with a server or host that supports the rule. Request the public old URL to verify the actual status and destination.

02Why does my Nuxt redirect work locally but not after deployment?

Your production preset or static host may handle redirects differently from the development server. Confirm the generated output and configure the host or CDN when it does not serve HTTP redirects itself.

03Should I redirect a deleted page to the homepage?

Only if the homepage is a genuinely relevant replacement. Otherwise return a 404 or 410; sending unrelated deleted URLs to the homepage can mislead visitors and search engines.

Sources · 4

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • nuxt.com
  • nitro.build
  • google.com
  1. 01Nuxt Configuration: routeRules | Nuxt Docsnuxt.com · checked 2026-10-24
  2. 02Rendering Modes | Nuxt Docsnuxt.com · checked 2026-10-24
  3. 03Nitro configuration: routeRulesnitro.build · checked 2026-10-24
  4. 04Redirects and Google Search | Google Search Centraldevelopers.google.com · checked 2026-10-24
Free · 2 minutes

Tools point. Agencies advise. This one ships.

Run the free audit, then approve the fixes. Every change can be undone.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • 0→7 ChatGPT citations in six weeks Paylane