related sites: <FREE Help> <ASP> <Asp.net> <worldwide> feedback: <lovethat> <hatethat> <thanks> <credits> <contact us>
NotFound - Configuration <Next>
Handling NotFound URLs - A High Level Introduction
People need to get back to specific pages on your site so they don't have to hit the main and fish around for info. There are several obstacles to this on most web sites:
Obstacle #1: Frames so that the URL in the brower is not the URL of the page.
Obstacle #2: LongURLs, i.e. whatever.asp?code=admin&state=md&city=Rockville&context=a59it
Obstacle #3: You want to move files and rename them. Of course then their bookmark to that specific file is useless.
We don't have any frames. We don't have any LongURLs. That leaves obstacle 3. We do rename and move files to different directories -- but we guarantee all bookmarks work. And these old bookmarks account for a lot of traffic; in a typical day, if our main page is called 10,000 times 3,000 people hit the site for old bookmarks. Having them get a "this page is moved" is rude, but better than nothing. We just shuttle those people to it's new home invisibly and let them keep their bookmarks forever. How?
First, we made an Access Database (we normally use SQLserver, but we wanted smaller sites without that option to be able to function) which we will show here with some sample data:
Then we made a script called notfound.asp (invoked as an IIS4 404 Handler) which will accomplish the following:
You can download our database from http://www.activeserverpages.com/databases/wwwactiveserverpagescom.mdb
Here is the notfound.asp that is tied to our 404 page and handles all database access:
<Test Script Below>
<%originalURL=lcase(request.servervariables("QUERY_STRING"))%> <!--#INCLUDE VIRTUAL="/library/emailbadpage.asp" -->