Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/inbo/inbo.github.io

Organization site to redirect old GitHub Pages URLs
https://github.com/inbo/inbo.github.io

configuration github

Last synced: about 1 month ago
JSON representation

Organization site to redirect old GitHub Pages URLs

Awesome Lists containing this project

README

        

# inbo.github.io

Organization site to redirect old GitHub Pages URLs.

## Problem

[Renaming](https://docs.github.com/en/repositories/creating-and-managing-repositories/renaming-a-repository) or [transferring](https://docs.github.com/en/repositories/creating-and-managing-repositories/transferring-a-repository) a repository has an impact on URLs:

- ✅ New repo URL `https://github.com//` is created.
- ✅ Old repo URL `https://github.com//` will automatically redirect to the new repo URL.
- ✅ New GitHub Pages URL `https://.github.io/` is created.
- ❌ Old GitHub Pages URL `https://.github.io/` returns a 404 error.

Any reference to the old Github Pages URL `https://.github.io/` is now broken.

## Solution

This `https://github.com//.github.io` repository has an associated [organization site](https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-github-pages-site#creating-a-repository-for-your-site), served from `https://.github.io`. By creating subdirectories, we can redirect old GitHub Pages URLs:

1. Rename or transfer your ``. This will break the old GitHub Pages URL `https://.github.io/`.
2. Create a directory in this repository, named `` (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



```

4. Commit.
5. A page will now be served from the old GitHub Pages URL `https://.github.io//`. It will redirect without delay to the new GitHub Pages URL.

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

- Add a `404.html` with the same content as `index.html` to redirect all subpages to the new homepage.
- Add a `path/to/subpage/index.html` file (with specific `URL`) to redirect a specific subpage.