The Redirects component theme for Cecil provides support of _redirects file generation.
After installation and without any configuration, this component theme generates a _redirects file containing HTML redirections created by Cecil, in all languages (automatic or created manually with the redirect front matter variable).
Services that support the _redirects file:
composer require cecil/theme-redirectsOr download the latest archive and uncompress its content in
themes/redirects.
Add redirects in the theme section of your site configuration:
theme:
- redirectsserver:
redirects:
- from: https://xxxxxx/*
to: https://xxxxxx/:splat
status: 301 # HTTP status code, optional (301 by default if `force` is set)
force: true # redirect even if the file exists, optionalThe demo/ website uses the theme under development and covers the supported cases (multilingual aliases, redirect front matter, redirections with and without status / force):
php demo/link.php
php cecil.phar build demoThe generated demo/_site/_redirects file must match demo/expected/_redirects: this is checked by the Test workflow.
Redirects is a free software distributed under the terms of the MIT license.