News Section - Custom 404 Files, using ASP or .Net
Developer Blog from Mike Irving - Custom 404 Files, using ASP or .Net
22/7/2008 - Custom 404 Files, using ASP or .NetMany web developers setup Custom 404 Files on their Websites to present a user-friendly alternative to the browser's own "File Not Found" page, however we can do a whole lot more when we start scripting within our 404 file.
We can perform 301 Redirects from old page names, to new ones, useful for SEO purposes.
We can serve a non-physical robots.txt file dependant on the HOST name. this is useful if your web server serves your site on multiple domains. You will only want Google and Search Engines to crawl one of the domains, to avoid duplicate content issues, so using the 404 page we can deliver either a Spiderable Robots file, or otherwise, dependant on the domain.
We would chnage the page Content Type to "text/plain" and the Status Code to "200" / OK in or robots.txt case.
We can also use the 404 file for simple URL Rewriting. A list of URL Rewrites can be handled in the 404 file, and a page can be delivered for each, as desired. In this case, we would change the page Status code to 200/OK on delivery, as opposed to 404/Not Found.
All of the above can be achieved easily using ASP or ASP.Net, or indeed any other scripting language.
You will need to setup the Custom 404 functionality on your web server, or with your hosting company. This can either be done direct in IIS, or is usually a setting available in your Web Hosting provider's control panel.
Page Not Found files can offer much more than meets the eye!
View Blog Entries - Page: 1, 2, 3, 4, 5, 6
For a while now I've been writing AJAX-Enabled ASP.Net 2.0 Web Applications in Visual Studio 2005, but last week I got the opportunity to add some new functionality to a website that used AJAX in ASP....
• Read This Blog Entry
In today's increasingly networked world, the internet provides many ways of working both remotely and virtually. When at a remote location, we can take advantage of VPN technologies, Remote Desktop...
• Read This Blog Entry
Earlier this week I tried importing a Local IIS website in Visual Studio 2005 on my new Windows Vista PC. Interestingly, if I clicked "Open Website" then clicked the "Local IIS" option, I received ...
• Read This Blog Entry

