For some Jekyll sites, setting up URL re-writes or HTTP 301 Moved Permanently response codes on HTTP web servers (such as Apache or NGINX) is not possible. If you reorganise your site, external links to your original pages will be broken, which is not a great web experience.
The redirect layout creates an HTML redirection page from the original page URL to its new location.
- Copy the
_layouts/redirection.htmlfile to your Jekyll
- Optionally create a
_redirectsfolder, adding it to the
include:section of your
- Create a page with the front matter below. The redirect file name is not important as the original and redirect page URLs are controlled by
redirectfront matter settings.
--- layout: redirection permalink: /path/to/original/page/ redirect: /path/to/correct/page/ ---
NB: The layout has been renamed from
redirection.html to avoid interference with jekyll-redirect-from plugin.