 2002 Visual Studio Magazine 
Fawcette Technical Publications

Issue: February 2002
Section: Online
Author: Jonathan Goodyear
Filename: vs0202jg

This articles project customizes the standard IIS 404/Page Not Found page so it performs double duty. If the browser requests an article from a spoofed URL, then the browser is re-directed to the real article page. If a bad URL is requested, then a Page Not Found error is displayed to the user. 

1) Place the Article.asp and ArticleCheck.asp files in the root path of your ASP.NET web application.
2) Open up the Internet Services Manager utility.
3) Right-click on your web site and select the "Properties" menu option. The Web Site Properties dialogue should appear.
4) Click on the Custom Errors tab.
5) Double-click on the 404 item in the listbox.
6) On the Error Mapping Properties dialogue that appears, select URL from the Message Type dropdown box, and enter your ArticleCheck.asp page's virtual path (should be "/ArticleCheck.asp")
7) Click on the OK button of the Error Mapping Properties dialogue.
8) Click on the OK button of the Web Site Properties dialogue.
9) Open up your browser and navigate to (http://localhost/articles/mycolumn/2001/10/31/). Your browser should be re-directed to the Article.asp page, which displays the contents of the article URL that you specified. You can substitute your own values for "mycolumn" and the other date elements of the URL path parameters.
10) Try entering a bogus URL to see the standard "Page Not Found" message.

Enjoy!
