diff --git a/src/content/docs/en/guides/integrations-guide/netlify.mdx b/src/content/docs/en/guides/integrations-guide/netlify.mdx index 6455bf9131ae3..d70e4248bee75 100644 --- a/src/content/docs/en/guides/integrations-guide/netlify.mdx +++ b/src/content/docs/en/guides/integrations-guide/netlify.mdx @@ -84,6 +84,32 @@ export default defineConfig({ }); ``` +### Static sites + +For static sites you usually don't need an adapter. However, if you use `redirects` configuration (experimental) in your Astro config, the Netlify adapter can be used to translate this to the proper `_redirects` format. + +```js +import { defineConfig } from 'astro/config'; +import netlify from '@astrojs/netlify/static'; + +export default defineConfig({ + adapter: netlify(), + + redirects: { + '/blog/old-post': '/blog/new-post' + }, + experimental: { + redirects: true + } +}); +``` + +Once you run `astro build` there will be a `dist/_redirects` file. Netlify will use that to properly route pages in production. + +:::note +You can still include a `public/_redirects` file for manual redirects. Any redirects you specify in the redirects config are appended to the end of your own. +::: + ## Usage [Read the full deployment guide here.](/en/guides/deploy/netlify/)