This template repository allows you to quickly and easily redirect GitHub Pages sites when their repositories are renamed or transferred from one user or organization to another.
To create a redirect, you must first create a user or organization GitHub Pages site from this template:
- Click Use this template.
- Use the Owner drop-down menu, and select the account you want to own the repository.
- Name the repository
username.github.io
, whereusername
is your username (or organization name) on GitHub. - Click Create repository from template.
To create a redirect from one GitHub Pages URL to another:
-
Create a new markdown file with the same name as old Pages repository you'd like to redirect from. (e.g.
old-name.md
) -
Add the following to the top of the new markdown file:
--- redirect_to: <new-repo-url> ---
You renamed your Pages repository from foo
to bar
and need to redirect username.github.io/foo
to username.github.io/bar
.
From your account Pages site repository (github.com/username/username.github.io
), create a new markdown file named foo.md
and add the following to the top of the file:
---
redirect_to: username.github.io/bar
---
Install dependencies:
script/bootstrap
Run the server locally:
script/server