Preventing Broken Links

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.

Yesterday, I finally found a use for the root http://ssokolow.com domain… I delegated it to GitHub to shorten and professionalize URLs for my projects. (eg. http://ssokolow.com/quicktile)

…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)

Creative Commons License
This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.

This entry was posted in Geek Stuff. Bookmark the permalink.

One Response to Preventing Broken Links

  1. Diana Anderson says:

    Thanks for the step by step process. This really helps! I have been lost for a while now.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution under the same terms as the associated post.