Jacques Mattheij

Technology, Coding and Business

301 redirects a dangerous one way street!

Best practice has it that when you move content around for whatever good reasons you have that you should do it using a 301 redirect.

If you’ve done this in the past and it looks like it works the way you intended then good for you.

What you probably didn’t realize is that browsers cache 301 redirects agressively and there is nothing short of a complete cache wipe by the user that you can do to re-vive a url that has been redirected. Moved permanently indeed! Maybe that should read ‘Moved eternally’!

You can improve a bit on this by sending along a bunch of cache control headers to at least limit the damage. But that won’t change a thing for people that already have your old 301 cached.

This can be especially painful when you’ve redirected an old domain to a new one, even the / index file will be redirected and there isn’t a thing that you can do about it. The old domain has become practically unusable if enough people have visited it.

Beware of this nasty little pitfall and think twice before you use a 301 redirect, it may be ‘best practice’ but there are serious consequences if you change your mind later on!