Research Institute for Nature and Forest (INBO)

inbo.github.io

Organization site to redirect old GitHub Pages URLs.

Problem

Renaming or transferring a repository has an impact on URLs:

Any reference to the old Github Pages URL https://<org>.github.io/<repo> is now broken.

Solution

This https://github.com/<org>/<org>.github.io repository has an associated organization site, served from https://<org>.github.io. By creating subdirectories, we can redirect old GitHub Pages URLs:

  1. Rename or transfer your <repo>. This will break the old GitHub Pages URL https://<org>.github.io/<repo>.
  2. Create a directory in this repository, named <repo> (see the repo for examples).
  3. Add an index.html to that directory, with the following content (replace the URL with the new GitHub Pages URL):
<html>
  <head>
    <meta http-equiv="refresh" content="0;URL=https://<new_org>.github.io/<new_repo>/">
  </head>
</html>
  1. Commit.
  2. A page will now be served from the old GitHub Pages URL https://<org>.github.io/<repo>/. It will redirect without delay to the new GitHub Pages URL.

Note that only the homepage https://<org>.github.io/<repo>/ will be redirected. This is typically sufficient, since subpages are seldom referenced elsewhere. To redirect subpages, either: