<% querystring=trim(replace(request.servervariables("query_string"),"404;",""))
' Grab the server varible for querystring. If the user was redirected to
' this page beacuse a file was not found the server variable query_string
' would contain a string similar to this convention
' 404;http://www.yourservsername.com/name_of_missing_file.ext
' for display pirposes the 404; is removed via text replace
if querystring <> "" then %>
The item you were looking for
<%
' If you have CDONTS installed this will send a mail message to any address you want
' However, this portion of the script has been commented out to avoid us getting mail
' from the output of this script
if right(referrer,3) <> "ico" then
' Check to see if the file missing is an ico request
' IE 5 looks for it everywhere and you may want to filter it out
' as a 404 error for an favicon.ico or one with a broken link in
' LINK REL="SHORTCUT ICON" will not result in the user being redirected to this page
' Here we begin building our mail message varible
' by stating which document as missing and when the error occurred
' and follwing it with all the servervaribles (This will tell which browser
' they were using and a few other helpful items
' message = message + "The following page was requested and not found on the server at " & now() &chr(13)
' message = message & querystring & " " & message_rpt
' set sm = server.createobject("CDONTS.newmail")
' Create the CDONTS mail object
sm.from = "404@blir.com"
sm.to = "casey@blir.com"
' Set the mail adress for the sender and the mail address that
' will receive the message they both should be valid addresses
sm.subject = "File Not Found - "& querystring
' Create a subject with name of the location that was requested
sm.bodyformat = 0 'if sending as HTML
sm.mailformat = 0 'if sending as HTML
' Place the mail format to html
sm.body = message
' Set the body of the message equal to the text string created
sm.send
' Send the mail message
set sm = nothing
' Clean up the server
end if 'End check for .ico files
else
' If a user were to directly hit your 404 error page
' without generating an error display this alternate message
%>
You have reached the 404 error page however,
<% end if 'end check of querystring values %>
To return to the page you were previously on click here.
<%= querystring %>
could not be located on the server.
An email message has been sent to the webmaster to correct this ASAP.
Below are all the server varibles for the request
we could not detect a broken link or a missing file