The Netlify component theme for Cecil provides support of Netlify's _redirects and _header.
After installation and without any configuration, this component theme generate:
- a
_redirectsfile containing HTML's redirections created by Cecil (automatic or created manually with theredirectfront matter variable) - a
_headersfile containing HTTP headers created by Cecil (generated fromheaders' configuration)
composer require cecil/theme-netlifyOr download the latest archive and uncompress its content in
themes/netlify.
Add netlify in the theme section of your site configuration:
theme:
- netlifynetlify:
redirects:
- from: https://xxxxxx/*
to: https://xxxxxx/:splat
status: 301 # optional
force: true # optionalRefer to Netlify documentation for details.
netlify:
redirect_by_language: true # false by defaultIt generate the following redirect for each available language (other than the default):
/ /<language-code>/ 302! Language=<language-code>
Example:
/ /fr/ 302! Language=fr
The language can be specified in the cookie
nf_lang, so you can override the default behavior with JavaScript (in case of a language dropdown selector for example).
server:
headers:
- path: <path> # Relative path, prefixed with a slash. Support "*" wildcard.
headers:
- key: <key>
value: "<value>"