An organization-level inbo.github.io website to allow URL redirects when our repositories have been renamed or moved.
Adapted from https://gist.github.com/domenic/1f286d415559b56d725bee51a62c24a7:
We have a repository, e.g.
inbo/repo. We would like to rename it to
inbo/repository or transfer it to the organization
trias-project, so it will become
However, we make heavy use of the GitHub Pages feature for that repository, so that people are often accessing
https://inbo.github.io/repo/. GitHub will helpfully redirect all of our repository stuff hosted on github.com after the move, but will not redirect the GitHub Pages hosted on github.io.
We solve this by having this
inbo/inbo.github.io repository, which creates an organization-level
https://inbo.github.io GitHub Pages website. We now can:
Add a file
repo/index.html to this repository, which uses
<meta http-equiv="refresh"> to redirect to the new URL. The
index.html file should look like this:
<!DOCTYPE html> <meta charset="utf-8"> <title>Redirecting to new URL</title> <meta http-equiv="refresh" content="0; URL=https://trias-project.github.io/repo/"> <link rel="canonical" href="https://trias-project.github.io/repo/">
https://inbo.github.io/repo/ will still exists as a working URL, even though the
inbo/repo repository does not. And it will redirect to the new URL, e.g.
https://inbo.github.io/repository (for rename) or
https://trias-project.github.io/repo/ (for transfer).