# Nuxt redirects

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

Canonical: https://scaplet.com/seo/nuxt/redirects

Guide Nuxt Nuxt · URL migrations

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 with [ChatGPT](https://chatgpt.com/?hints=search&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnuxt%2Fredirects%20(%22Nuxt%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Claude](https://claude.ai/new?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnuxt%2Fredirects%20(%22Nuxt%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [Perplexity](https://www.perplexity.ai/search?q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnuxt%2Fredirects%20(%22Nuxt%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.) [![Google](/logos/ai/google-color.svg)AI Mode](https://www.google.com/search?udm=50&q=Summarize%20https%3A%2F%2Fscaplet.com%2Fseo%2Fnuxt%2Fredirects%20(%22Nuxt%20redirects%22)%20in%205%20bullet%20points%2C%20then%20tell%20me%20the%20one%20thing%20I%20should%20do%20next.)

On this page

## 3 parts, 3 minutes.

1. [Add an explicit server route rule 01](#add-an-explicit-server-route-rule)
2. [Test the rendered deployment, not only the config 02](#test-the-rendered-deployment-not-only-the-config)
3. [Preserve search and visitor signals during a move 03](#preserve-search-and-visitor-signals-during-a-move)

_01_Checklist

## 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](/glossary/http-status-codes). Nitro documents that a string value such as `redirect: '/new-page'` uses 307 ([Temporary Redirect](/glossary/302-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. 01 Choose a permanent status for a permanent move and point directly to the final [canonical URL](/glossary/canonical-url).
2. 02 Keep temporary redirects temporary while a migration is being tested or when the source page will return.
3. 03 Avoid [redirect loops](/seo-issues/redirect-loops) and chains. Update [internal links](/glossary/internal-links), canonicals, and sitemap entries to point at the destination instead of relying on the old URL forever.
4. 04 Nitro 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 } } } })
```

_02_How 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.

**Static hosting needs redirect support**A generated static site cannot return an HTTP redirect unless the deployment platform supports a redirect file or rule. Nuxt says it applies route rules to the platform's native rules where possible (currently Netlify and Vercel) and that hybrid rendering is not available with `nuxt generate`. Configure the host or CDN for the final response and test the public URL after deploy.

_03_Choose 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](https://nuxt.com/docs/4.x/api/nuxt-config#routerules), Google's [redirect guidance](https://developers.google.com/search/docs/crawling-indexing/301-redirects), and our [redirect chains diagnostic](/seo-issues/redirect-chains).

Questions

## Asked a lot.

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

_01_ How 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.

_02_ Why 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.

_03_ Should 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. 01 [Nuxt Configuration: routeRules | Nuxt Docs](https://nuxt.com/docs/4.x/api/nuxt-config#routerules) nuxt.com · checked 2026-10-24
2. 02 [Rendering Modes | Nuxt Docs](https://nuxt.com/docs/4.x/guide/concepts/rendering) nuxt.com · checked 2026-10-24
3. 03 [Nitro configuration: routeRules](https://nitro.build/config) nitro.build · checked 2026-10-24
4. 04 [Redirects and Google Search | Google Search Central](https://developers.google.com/search/docs/crawling-indexing/301-redirects) developers.google.com · checked 2026-10-24

## Keep learning

[All platform guides](/seo)

[Learn Nuxt SEO Frameworks](/seo/nuxt) [Related 301 redirect Crawling and indexing](/glossary/301-redirect) [Read next Nuxt XML sitemap Frameworks](/seo/nuxt/xml-sitemap) [Do Run a free site audit Free, about two minutes](/site-audit)

Nearby in platform guides
[Nginx custom 404 page](/seo/nginx/404) [Nuxt SEO](/seo/nuxt) [Rank Math SEO plugin setup](/seo/rank-math/seo)

More in Nuxt SEO
[Nuxt redirects](/seo/nuxt/redirects) [Nuxt XML sitemap](/seo/nuxt/xml-sitemap)

Terms on this page
[HTTP status codes](/glossary/http-status-codes) [302 redirect](/glossary/302-redirect) [Canonical URL](/glossary/canonical-url) [Internal links](/glossary/internal-links)

Free · 2 minutes

## Tools point. Agencies advise. _This one ships._

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

[Audit my site free](/site-audit)

Free, no card 60 seconds Nobody will call you

- **46** fixes shipped without a ticket Brightpipe
- **0→7** ChatGPT citations in six weeks Paylane
