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 Enterprise Pages does not support customer server configuration files such as .htaccess
or .conf
. However, using the Jekyll Redirect From plugin, you can automatically redirect visitors to the updated URL.
Setting up
To enable redirects, you must add the following line to your site's _config.yml
file:
gems:
- jekyll-redirect-from
If you don't have a _config.yml
file, you will need to create one in the root of your GitHub Enterprise Pages repository. For more information, see the Jekyll documentation.
The GitHub Pages website lists the exact versions of the plugins used by the GitHub Enterprise Pages server.
Usage
To redirect a page from /foo
, add the following to the top of the page:
---
redirect_from: "/foo"
---
Testing locally
To verify redirects locally:
- Add
jekyll-redirect-from
to your site's_config.yml
file - Make sure you're using the latest version of the GitHub Pages Gem
For more information, see The Jekyll Redirect From Gem.