404 and 500 Custom Error Pages

Discussion in 'Hosting Services / Control Panel' started by ubelt, Apr 6, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have created custom 404 and 500 Error Pages.

    I wanted to capture the page's URL where 404/500 error occured. I tried using Request.ServerVariables(HTTP_REFERER) but it is getting an empty string.

    Is there any way to get the page's URL?

    Thanks.
     
  2. The custom 404 ASP page should be able to get the referer value. I just tested it on my site. You do need the HTTP_REFERER in quotes.
     
  3. Lukas,

    I do have it in quotes.

    Here's my code:

    <p><%=Request.ServerVariables("HTTP_REFERER")%></p>
    <p>Page Not Found</p>

    I'm still getting an empty string.
     
  4. I got it wrong when I was testing it. I was entering the invalid URL at the browser instead of clicking. That's why the HTTP_REFERER is empty.

    However, when I tried clicking an Invalid URL, the value I'm getting for HTTP_REFERER is the page where I clicked the URL. I was hoping to get the Invalid URL itself.
     
  5. The QUERY_STRING value should give the broken link URL.
     
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