• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 454
  • Last Modified:

page 404 error without referring url

Hi all,
I've written as custom 404.asp page, which works fine - most of the time!  It emails the page error to me including the page name, which is obtained from:
request.servervariables("http_referer") and request.serverVariables("Script_Name")

However, on a regular basis I'm getting email because of a 404 error where the request.servervariables("http_referer") is blank - so I can't track down what is causing the error?!

Any ideas as it is driving me nuts!?

Regards

JamWales
0
Jamie
Asked:
Jamie
  • 3
  • 2
1 Solution
 
yonatanzCommented:
Hi JamWales,

This probably happens because the client browser did not specify a Referrer HTTP header.
While most browsers will specify such a header, some might not in some cases.

A few such conditions come to mind:
1. A user clicked a link in their favorites (or bookmarks), hence there is no referrer
2. A user typed the URL directly, again there is no referrer
3. The user's browser is set not to pass referrer information.
4. A non-mainstream user-agent was used (maybe a crawler bot, or some other non-browser program)

Depending on your website, and the non-existing page, any of the above or other causes may be possible.
Maybe looking at request.servervariables("HTTP_USER_AGENT") will give you more insight?
0
 
JamieAuthor Commented:
Hi yonatanz,
Many thanks for your reply. I've changed the email to include all request.servervariables - see what then next blank http_referer brings via the other request.servervariables say - should get one in about 5 minutes!
Regards
JamWales
0
 
JamieAuthor Commented:
Hi yonatanz,
Looked at the request.servervariables  - and the QUERY_STRING  it refers to does not appear in the page it references, anywhere, both visually and in the code behind?!?
I'm still at a total loss?
Regards
JamWales
0
 
yonatanzCommented:
Hey there JamWales,
I suppose you looked carefully at the server variables and couldn't figure out a possible cause.

Can you show me those variables? maybe obfuscate any sensitive information after you copy-paste.
0
 
JamieAuthor Commented:
Hi yonatanz:
Thanks for your reply. I woke up this morning - at 5am with a thought!
I turned off my custom error 404 page, and the errors returned pointed me to the exact problem - so all is sorted now. Not sure why my custom 404 did not give the same info - but that's life I suppose.
Thanks for all your input.
Regards
JamWales
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now