Redirects on GitHub Pages
When a Jekyll post or page's title or date changes, existing links to the site may break. For the security of our users, GitHub Pages does not support customer server configuration files such as
.conf. However, using the Jekyll Redirect From plugin, you can automatically redirect visitors to the updated URL.
GitHub Pages is available in public repositories with GitHub Free, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see "GitHub's products."
To enable redirects, you must add the following line to your site's _config.yml file:
plugins: - jekyll-redirect-from
If you don't have a _config.yml file, you will need to create one in the root of your GitHub Pages repository. For more information, see Jekyll's official plugins documentation.
To redirect a page from
/foo/ to another page, add the following to the top of the target page:
To verify redirects locally:
jekyll-redirect-fromto your site's _config.yml file
- Make sure you're using the latest version of the GitHub Pages Gem, which contains these dependencies and plugins.
For more information, see The Jekyll Redirect From Gem.