Skip to content

Latest commit

 

History

History
52 lines (34 loc) · 2.04 KB

configure-netlify-redirects.adoc

File metadata and controls

52 lines (34 loc) · 2.04 KB

Netlify redirects configuration

Configuration files

We use a netlify.toml file at the root of the project.

See the Netlify documentation for more details about the how to configure the redirects.

Antora is configured to generate a Netlify _redirects file to manage aliases. The file is generated in build/site. See Antora and Netlify documentation for more details.

Be aware of the Netlify rule processing order for rules declared in _redirects and netlify.toml.

Testing the redirects

Testing can be done locally thanks to the dev server provided by the Netlify CLI.

It is able to use the netlify.toml used in production and

More details about redirects handling in the Netlify documentation.

Step-by-step procedure

  • Build a preview with the components and versions needed for the test. See README.
    Add the --type netlify parameter to use the configuration for the whole Netlify environment.

  • Start the http dev server (see README)

  • In the console, you can see the redirect configuration currently used.

  • Any changes in the Netlify redirects configuration is taken into account right away by the server, so the feedback loop is intended to be very short

⚠️

If your redirect returns 200, the url won’t be updated when you test the redirect.
To validate it works you have to check the content of the page.