Importancy of the '301' status code

The glorious 301 (three-oh-one) status code can save you alot of trouble when upgrading a website. Especially if you care about google ranks, and assisting your visitors...

During the upgrade to vikkel.dk / vikkel.com I had to do a little 301 implementing myself. See, the old blog-system was built in old-fashioned asp (vbscript), and this new glorious blogging tool is written in asp.net (c#).

The problem at hand:
  • Old (filename.asp) URL's are becoming obsolete.
  • New (newfilename.aspx) URL's are entering the stage - but nobody knows about it (especially not the global search engines!).

In order to cure these 2 issues, i had to do the following:
Strip the old scripts for all code, and enter new, valid, 301 redirection code.

Mainly the "entry.asp" file, which displayed all the posts (using old-fashioned querystring values) had to be updated.

Heres the content of that entry.asp file now:
301 solution

As you can see it actually captures any of the incoming article links, and diverts them to their new URL. Piece of cake!
If i had not done this then right now all links coming from google (or other search engines, including bookmarks), would be pointing at something obsolete. And maybe even worse - at a non existing file due to deletion.


Regardless of what server/solution change you do - ALWAYS make sure you use a 301 redirect from old files to new ones. Otherwise you might as well put a "Sorry, we're closed" sign at your frontpage. Not sure how to do it in your IIS environment..? Let me know, and I will write some more guides.

I've also been doing this at work when we changed CMS to "Sitecore". Even though it meant cleaning 300+ files and making them point at the new version. Boring, but worthwhile and crucial.

Print | posted on Thursday, February 01, 2007 7:34 PM

Feedback

Gravatar

# re: Importancy of the '301' status code
6/29/2010 9:05 AM laurenti

Is there an upgraded version of this? It seems that it's not updated. It's old and basic solution. The easiest process is on the new script.

dissertation help
Gravatar

# re: Importancy of the '301' status code
7/2/2010 6:25 PM Karen

Thank you soo much! This tip is super useful!
Gravatar

# re: Importancy of the '301' status code
8/29/2010 4:23 PM aaa

abercrombie londonnice postabercrombieI second albertacowpoke's questionabercrombie and fitchThanks for sharingabercrombie ukIt is hard to say such a thing is clear.アバクロ 銀座Significant change, it is.tiffany ukI'm sorry that's j o c not LOC.abercrombieWell saidAbercrombie outletsuch a person should be a good sentence, Abercrombie clothingor the future will be more rampant.ed hardy ukwill be happy to love kills slowlybe proved wrong with this one.abercrombie outlet but having done survival training duringabercrombie clothing my Army daysabercrombie and fitch ukI have to admit to abercrombie fitch uka raised eyebrow with this Abercrombie & fitch ukas well.アバクロ 通販Everywhere in the LVアバクロ 激安Er, are you having trouble posting something? abercrombie ukIf you just want to test out the story creation processabercrombie and fitch ukI hate guns If no guns of everyoneAbercrombie & Fitch UKthe world maybe well.abercrombie fitch ukThe first one is very nice.. I like it very much..?
Gravatar

# re: Importancy of the '301' status code
9/2/2010 10:39 AM Asics Shoes

Thanks for putting the thought in and writing it
Title  
Name  
Email
Url
Comments   
Please add 5 and 2 and type the answer here: