Welcome to my ASP Code Website

Creating a Pretty 404 Page

If you're like most of the web, you have broken links on your site sometimes. Here's how to make a pretty 404 page that actually helps your users out.

First, create a simple page and call it 404.asp. It's best to just put it in your root directory of your website. Have it say something like "The page you found is not available, please choose from this list of other commonly requested pages" and then add links to a few of your most popular pages.

Now to actually have this page SHOW when a user gets a 404 error on your site. If you have control over your own server settings, you would make this change yourself in IIS. If you do not, ask your hosting company to make this IIS change for you.

* Go into the IIS Manager
* Click on the icon for your website
* Right click and choose PROPERTIES
* Click on the CUSTOM ERRORS tab
* Scroll down until you see the entry for error 404
* Click on that line and click the EDIT PROPERTIES tab
* choose URL in the MESSAGE TYPE dropdown
* put in /404.asp as the filename

Save and exit! Now any time you get a broken link on your site it will go to the 404.asp page you have made. You can make that page as pretty or complex as you wish. You can in fact simply have that page have code to redirect the user back to your site homepage.

ASP Server Setup Information