<%@LANGUAGE="VBScript"%> <% 'prevent any other errors from stopping execution Option Explicit On Error Resume Next '''Original Contents Dim requestpage:requestpage = replace(Request.ServerVariables("QUERY_STRING"),"404;","") Dim forumABSURL:forumABSURL = replace(Request.ServerVariables("SCRIPT_NAME"),"pgdrewrite.asp","",1,-1,vbTextCompare) Dim errorLogFileName:errorLogFileName = "upfiles/404.log" Dim requestedFile:requestedFile = lcase(right(requestpage,len(requestpage)-instrrev(requestpage,"/"))) if (requestedFile="tm.htm") then Server.Transfer (forumABSURL&"tm.asp") if (requestedFile="tt.htm") then Server.Transfer (forumABSURL&"tt.asp") if (requestedFile="printable.htm") then Server.Transfer (forumABSURL&"printable.asp") if (requestedFile="ini.asp") then Server.Transfer (forumABSURL&"ini.asp") if (requestedFile="boarddown.asp") then Server.Transfer (forumABSURL&"boarddown.asp") strDetail = "404 error occured: " & Now & vbCrlf & _ "Requested Page: "&requestpage& vbcrlf &_ "Referer: "& Request.ServerVariables("HTTP_REFERER") & vbcrlf &_ "Requested by IP: "&Request.ServerVariables("REMOTE_ADDR")&vbcrlf&_ "User Agent: "&Request.ServerVariables("HTTP_USER_AGENT") 'The following are for writing custom error logs Dim writeLog:writeLog = true if writeLog then Dim strErrorLog:strErrorLog = Server.mappath(errorLogFileName) Dim objFSO, objTStream, strDetail Dim blnFailedToLog Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objTStream = objFSO.OpenTextFile(strErrorLog, 8, True) '8 = ForAppending If Err.Number = 0 Then objTStream.WriteLine strDetail & vbCrlf & vbCrlf If Err.Number = 0 Then objTStream.Close blnFailedToLog = False Else blnFailedToLog = True End If Set ojFSO = nothing Set objTStream = nothing end if %> <% Response.Status = "404 Not Found" %> The page cannot be found

The page cannot be found

The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Please try the following:

  • Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly.
  • If you reached this page by clicking a link, contact the Web site administrator to alert them that the link is incorrectly formatted.
  • Click the Back button to try another link.

HTTP Error 404 - File or directory not found.
ASPPlayground.NET SQL Forum Software


<% If blnFailedToLog Then Response.Write "

WARNING: Cannot log error to file '" & strErrorLog & "'.

" End If %>

Technical Information (for support personnel)

  • Go to Microsoft Product Support Services and perform a title search for the words HTTP and 404.
  • Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Web Site Setup, Common Administrative Tasks, and About Custom Error Messages.