TL;DR: If you’re going to move to a new URL, fill out my templates and put them at the old one to make damn sure other people’s links don’t break.
…but that meant that I could no longer use
.htaccess to set up permanent redirects on URLs like http://www.ssokolow.com/ContactMe.
After a little research, it turns out that GitHub Pages doesn’t seem to have a method of declaring HTTP redirects… but Google and Yahoo will treat no-delay meta redirects as if they were HTTP 301.
Here’s what I came up with for a general, thorough way to ensure the least chance of broken links. (including
.htaccess in case I switch hosting in the future) The example assumes you’re moving a whole domain (eg. from SourceForge to GitHub), but it applies equally well to specific URLs within a domain.
(Also, don’t forget to use the change-of-address notification feature in Yahoo and Google Webmaster Tools)
Preventing Broken Links by Stephan Sokolow is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.