blob: e8d42848a2b014dd93caa637d4b885ef4fd96519 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
---
'astro': minor
---
Experimental redirects support
This change adds support for the redirects RFC, currently in stage 3: https://github.com/withastro/roadmap/pull/587
Now you can specify redirects in your Astro config:
```js
import { defineConfig } from 'astro/config';
export defineConfig({
redirects: {
'/blog/old-post': '/blog/new-post'
}
});
```
You can also specify spread routes using the same syntax as in file-based routing:
```js
import { defineConfig } from 'astro/config';
export defineConfig({
redirects: {
'/blog/[...slug]': '/articles/[...slug]'
}
});
```
By default Astro will build HTML files that contain the `<meta http-equiv="refresh">` tag. Adapters can also support redirect routes and create configuration for real HTTP-level redirects in production.
|