Skip to content

Commit

Permalink
Merge branch 'main' into css-inlining-2
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah11918 authored Jun 6, 2023
2 parents e7764e6 + 669b6d5 commit e7aa122
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/content/docs/en/guides/integrations-guide/netlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down

0 comments on commit e7aa122

Please sign in to comment.