clueless as to how this is happening....

This topic was created by pabc .

  1. pabc

    clueless as to how this is happening....

    my website uses htaccess to nicely handle 404s - and a little code ont he 404 page emails me if one is generated. This is so if I put up a bad link I'll know pretty quick.

    But recently, whenever a 404 occurs I immediately get another alert for the same non-existent page - always from the same IP.

    I'm really curious to know how this other 404 source is getting the information to try the non-existent address that someone else mistyped?

    Any thoughts as to how, or, just as usefully, where else I can ask this question?

    I've replicated this behaviour by navigating to random non-existent URIs from firefox 27 in safemode (linux), chrome33 with disable-extentions (linux) and android chrome (wifi / mobile data) so pretty sure it's not anything nasty on my side. I've grabbed the current 404 code from the site and there isnt anything in there either.

    1. h4rm0ny

      Re: clueless as to how this is happening....

      Sounds like the 404 page is being called twice if I understand your post correctly (you get two email alerts from the same IP address when you think there should only be one request).

      Do you have anything like a CSS or JavaScript query or something in the page, perhaps included by some template, that would also result in a 404 if the first call was wrong. E.g. because of a relative path? The best thing to do is check your Apache logs and watch when you try to access one of your randomly generated non-existent pages. If you see only one request come in, then there's only been one request - no need to mess around with different browsers because you now know for sure there aren't multiples. If you see something like "nonexistentdirectory/nonexistent.html" immediately followed by "nonexistentdirectory/botched_include_file.html" then you can now see why the 404 is getting called twice - the first bogus call is causing a second bogus call.

      Failing that, something bonkers in your re-write rules or similar? Check the Apache logs rather than testing different browsers without plugins. The logs will tell you whether you've made one request or two and what was being looked for each time.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2020