Article version: Enterprise Server 2.13

This version of GitHub Enterprise will be discontinued on This version of GitHub Enterprise was discontinued on 2019-03-27. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.

Redirects on GitHub Pages

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.

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 .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:

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.

Usage

To redirect a page from /foo/ to another page, add the following to the top of the target page:

---
redirect_from: "/foo/"
---

Testing locally

To verify redirects locally:

For more information, see The Jekyll Redirect From Gem.

Ask a human

Can't find what you're looking for?

Contact us