Custom Errors

Discussion in 'Classic ASP' started by Bruce, Oct 1, 2003.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Bruce

    Bruce DiscountASP.NET Staff

    I don't think you can do that with ASP (i may be wrong on this one). You can do such thing w/ ASP.net.

    The best way to identify invalid pages is through reviewing the web statistics or log file.


    quote:Originally posted by homeacademy

    I originally raised this question on technical support, and was told to post it here:

    I am setting up a custom error system for my site, using your Control Panel IIS Manager. I would like to perform actions based on the incorrect address. How can I detect (through ASP) the URL that generated the error?

    An example:
    A user enters an invalid URL, say http://www.domain.com/notfound.html. A 404 error is generated, and your custom error function redirects the user to http://www.domain.com/errormanager.asp. I want errormanager.asp to log the invalid URL (http://www.domain.com/notfound.html) to a database. I cannot figure out how to programmatically detect the invalid URL from my custom error page (errormanager.asp).

    Thanks in advance for the assistance.
    </blockquote id="quote"></font id="quote">
     
  2. I originally raised this question on technical support, and was told to post it here:

    I am setting up a custom error system for my site, using your Control Panel IIS Manager. I would like to perform actions based on the incorrect address. How can I detect (through ASP) the URL that generated the error?

    An example:
    A user enters an invalid URL, say http://www.domain.com/notfound.html. A 404 error is generated, and your custom error function redirects the user to http://www.domain.com/errormanager.asp. I want errormanager.asp to log the invalid URL (http://www.domain.com/notfound.html) to a database. I cannot figure out how to programmatically detect the invalid URL from my custom error page (errormanager.asp).

    Thanks in advance for the assistance.
     
  3. You're wonderful!! The querystring part is just what I was looking for! [:)] Everything works as it should now. Thanks alot for the assistance.
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    Very cool...

    Thanks Steurm

    quote:Originally posted by steurm

    You're welcome ... [^]

    --
    Steurm
    www.steurm.net/steurm
    </blockquote id="quote"></font id="quote">
     
  5. yes, you can do this with regular asp.
    You create an asp-page, e.g. error.asp where you will trap the errors, both asp-application errors and notfound-errors.
    In your application, configure your 404-errors to be redirected to this page (error.asp)
    (comment added later : and do the same for the 500.100 errors)

    This is some code to detect the errors:

     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page