# Astro redirects

> Configure Astro redirects for static and SSR sites, preserve route parameters, and verify that your host returns the intended HTTP status.

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

Guide Astro Astro · URL migrations

Configure Astro redirects for static and SSR sites, preserve route parameters, and verify that your host returns the intended HTTP status.

3 min

read

3

sources

Oct 24, 2026

updated

Scaplet Editorial Team

author

In one line

Add redirect mappings in `astro.config.mjs` for known route moves, then confirm how your deployment serves them. A static Astro build without a redirect-capable adapter outputs a meta refresh HTML page, which does not return an HTTP 301. SSR or a compatible static adapter can issue real redirect status codes. Remove route collisions and test the deployed response, destination, and query behavior.

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%2Fastro%2Fredirects%20(%22Astro%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%2Fastro%2Fredirects%20(%22Astro%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%2Fastro%2Fredirects%20(%22Astro%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%2Fastro%2Fredirects%20(%22Astro%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. [Decide what the production host can serve 01](#decide-what-the-production-host-can-serve)
2. [Add a route mapping 02](#add-a-route-mapping)
3. [Test migrations before and after release 03](#test-migrations-before-and-after-release)

_01_Astro config behavior depends on the output and adapter

## Decide what the production host can serve

Deployment

### Static build, no redirect-aware adapter

What Astro generates or serves

HTML with a [meta refresh](/glossary/meta-refresh); no HTTP redirect status from the server

Check

Request the old URL and inspect the actual status and `Location` header; expect a 200 with HTML

Deployment

### SSR output

What Astro generates or serves

Redirect response at request time

Check

Confirm the adapter and runtime preserve the configured status

Deployment

### Static output with a supported adapter

What Astro generates or serves

Adapter-specific redirect rules can be emitted

Check

Inspect the generated host config and test after deployment

Deployment

### Existing route has the old path

What Astro generates or serves

File-based route takes precedence over the config redirect

Check

Remove or rename the conflicting page file

Astro's routing guide says `astro build` outputs HTML files with a meta refresh tag by default, and that supported adapters write the host's redirect configuration instead. With SSR or a static adapter, the config reference says Astro serves redirected GET requests with a 301 and uses 308 for any other request method; set a `status` object to change that. Google lists a 0-second meta refresh as a [permanent redirect](/glossary/301-redirect) type, but ranks server-side redirects as the most likely to be interpreted correctly, so prefer a real HTTP redirect for moves that matter.

_02_Checklist

## Add a route mapping

1. 01 Use a permanent redirect when a page has moved for good; reserve a temporary status such as 302 for a genuinely temporary destination. The default is 301 where statuses are supported.
2. 02 Dynamic redirects are allowed as long as the old and new routes contain the same parameters, for example `/blog/[...slug]` to `/articles/[...slug]`. Astro's config reference says you can redirect static and dynamic routes only to the same kind of route. Redirects to external `http` or `https` URLs need Astro v5.2.0 or later.
3. 03 Configured redirects have lower priority than an existing page file at the same path. Remove the old route if it shadows the mapping.
4. 04 Astro's config reference marks a config listing both `/product1/` and `/product1` as not supported. Let the host normalize slash behavior consistently.
5. 05 For a static site, use your host's redirect file or adapter support when a real HTTP status matters to search engines and non-browser clients.

astro.config.mjs

```
import { defineConfig } from 'astro/config' export default defineConfig({ redirects: { '/old-guide': '/new-guide', '/news': { status: 302, destination: 'https://example.com/news' } } })
```

**Meta refresh is not an HTTP 301**A browser may navigate from a generated meta refresh page, but the server response is a normal 200 page and the configured status is not used. Google treats a 0-second meta refresh as a permanent redirect signal, yet other clients may not follow it. Check the HTTP status with a request tool after deployment instead of judging by the browser address bar.

_03_How it works

## Test migrations before and after release

Google recommends a permanent server-side redirect whenever possible to change the URL shown in [search results](/glossary/serp). See the [301 redirect guide](/glossary/301-redirect), [Astro routing and redirects](https://docs.astro.build/en/guides/routing/), and the [redirect chains diagnostic](/seo-issues/redirect-chains).

1. 01

### Build and inspect generated files

Search the build output for the old route. Confirm whether it contains meta refresh HTML or whether an adapter wrote host-level redirect rules.
2. 02

### Request the deployed old URL

Check status, `Location`, destination status, and whether the final page is the intended equivalent. Use GET as well as HEAD if your host handles those methods differently.
3. 03

### Test path variants and query strings

Check [trailing slash](/glossary/trailing-slash) behavior, encoded paths, and [campaign parameters](/glossary/utm-parameters). Make sure each old URL reaches one final canonical destination without a chain or loop.
4. 04

### Update internal references

Change navigation, canonical tags, and links to point directly at the destination. Keep the redirect for external [backlinks](/glossary/backlinks) and bookmarks.

Questions

## Asked a lot.

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

_01_ Does Astro return a 301 for a static redirect?

Not without an adapter that handles redirects. Astro's static build outputs an HTML page with a meta refresh tag, and the status code is not used by the server. Use SSR, a supported static adapter, or host-level redirect support when you need a real HTTP status.

_02_ Why is my Astro redirect ignored?

A file-based route at the same path takes precedence over a configured redirect, as the routing guide says. Remove or rename the conflicting route, rebuild, and test the deployed response.

_03_ Can Astro redirect a dynamic route to a static page?

Configured dynamic redirects require matching route parameter patterns on both sides. Use an explicit rule or host-level logic for a different route shape.

Sources · 3

## Every fact, linked and dated.

Official docs first. The date is when we last opened each page.

- astro.build
- google.com

1. 01 [Routing | Astro Docs](https://docs.astro.build/en/guides/routing/) docs.astro.build · checked 2026-10-24
2. 02 [Configuration Reference: redirects | Astro Docs](https://docs.astro.build/en/reference/configuration-reference/) docs.astro.build · checked 2026-10-24
3. 03 [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 Astro SEO Frameworks](/seo/astro) [Related Canonical URL Crawling and indexing](/glossary/canonical-url) [Read next Astro 404 page Frameworks](/seo/astro/404) [Do Run a free site audit Free, about two minutes](/site-audit)

More in Astro SEO
[Astro 404 page](/seo/astro/404) [Astro Google Analytics](/seo/astro/google-analytics) [Astro redirects](/seo/astro/redirects) [Astro robots.txt](/seo/astro/robots-txt) [Astro XML sitemap](/seo/astro/xml-sitemap)

Terms on this page
[Meta refresh](/glossary/meta-refresh) [301 redirect](/glossary/301-redirect) [Trailing slash in URLs](/glossary/trailing-slash) [UTM parameters](/glossary/utm-parameters) [Backlinks](/glossary/backlinks) [SERP](/glossary/serp)

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
