network cablingWhen a page on your website is missing, your server generates the 404 HTTP response code, usually just referred to as a “404”.  Not wanting to lose traffic from users who attempt to visit a page that no longer exists, or who mistype a URL, it is customary to redirect such users to another page on the website.  Different web servers have varied ways of setting this up.

In Microsoft IIS, there are actually two different places you have to configure a 404 handler.  In the IIS properties, you configure the handler for non-ASP.NET files:

IIS setup - error 404

In your web.config, you configure the target for your ASP.NET files:

<customErrors mode=”RemoteOnly”>
<error statusCode=”404″ redirect=”/test404.aspx”/>

It is important that the 404 behavior for your site be planned and not simply an afterthought.  I will give two scenarios:

Scenario one: I once had a customer that was a fairly large company with a number of websites, the largest of which received tens of thousands of visitors per day and was around #6000 in the Alexa rankings.  Their web servers seemed horribly overtaxed relative to their traffic so one day I did some analysis of their logs.  As it would turn out, fully one quarter of their web hits were 404’s for their two largest sites.  The biggest problem was that they did not have a favicon.ico.  Any time your browser gets a page on a site, behind the scenes, it is grabbing favicon.ico – this is the little icon that will appear to the left of the URL in your browser.  If you don’t have one, that generates a 404.  If your 404 page behavior is something non-trivial, that generates a lot of pointless work on the server.

Scenario two: I had noticed on a customer’s web server that if I visited a particular page, it slammed their server’s CPU usage.  That seemed a bit odd – there was nothing particularly complex on this one page.  So I used the new network tab in IE9 to see what light it could shed on the subject.  This tab showed that I was loading the home page for this site a large number of times in succession.  There was a JavaScript image loader on this page that was attempting to pre-load a number of images used for a particular third party control.  The problem was that the third party control itself had been removed from the page (along with all of its image files).  The 404 behavior for this site was to redirect the user to the home page, so for each one of these images, it was generating a hit to the home page.  The home page has a number of elements that are generated on the fly and not cached (a separate problem) and thus the spike in CPU usage.

Proper and improper configuration of handling error 404’s has other ramifications against on-page SEO (search engine optimization). But that’s another topic for another blog post.

Our team understands the importance of proper technical configuration of your website. Don’t leave these types of tasks to the amateurs. Contact our eBusiness team today to discuss your online presence.

Photo credit: Marvin Lee

Comments are closed.