[thelist] 404 Error Information

Veronica Yuill veronicay at archetype-it.com
Mon Mar 4 07:48:06 CST 2002


At 08:27 04/03/2002 -0500, you wrote:
>This message is in MIME format. Since your mail reader does not understand
>this format, some or all of this message may not be legible.
>--
>[ Picked text/plain from multipart/alternative ]
> >if you're using a url 404 handler, then yes.
>
>What is a URL 404 handler and how do I set it up on IIS?  (Sorry a google
>search did not turn up much useful information.)

<tip author="Veronica Yuill" type="Custom error pages with IIS">
In IIS 5: highlight the site in question, and bring up the Properties dialog.
Click the "Custom errors" tab -- you'll see a whole list of errors preceded
by their code.
Highlight 404 and click "edit properties".
Change the type to URL, and the file to *an http address*, *not* a physical
path on the server, e.g. /errors/404.asp is OK,
C:\INetPub\WWWRoot\errors\404.asp is not.
Click on OK and away you go (of course the 404.asp page must exist on the
local server!).
</tip>

IIRC it's very similar with IIS4.


> > the page they requested is available in cgi.query_string
>
>I have never heard of the cgi object.  Maybe I am confused and we are not
>talking IIS.  Maybe I am confused an we are.  Either way, how would I
>retrieve this value in an IIS environment.

No, that's not ASP speak. You need Request.ServerVariables("HTTP_URL"). It
should then be fairly straightforward to write an ASP script to redirect
the user depending on the page they were looking for. This snippet should
give you the info you need ...

   Dim strURL, strReferer

   strURL = Request.ServerVariables("HTTP_URL")
   strURL = Right(strURL, (Len(strURL) - (Instr(strURL, chr(59)))))
   strQueryString = Request.QueryString
   strReferer = Request.ServerVariables("HTTP_REFERER")
   response.write strURL & "<BR>"
   response.write strQueryString & "<BR>"
   response.write strReferer & "<BR>"



HTH



Veronica Yuill                 email: veronicay at archetype-it.com
Archetype Information Technology Ltd  http://www.archetype-it.com/english/
------------------------------------------------------------------
Dynamic websites for fast-moving businesses




More information about the thelist mailing list