RE: [PHP] 404 error checker
Jason, Thanks for the pointer. Worked like a charm, well almost. I had to tweak my .htaccess file as it was messing up some global variables cause i was using absolute URLS to point to my error script. Someone else ask to see the script. You can check it at: http://www.social-ecology.org/404.txt The top part of the script actually does all the funky passing of error info to a selected email, and the bottom part is the page that is displayed upon a 404 error. You'll have to mess with your .htaccess so it looks something like this: ErrorDocument 404 /404.php Thanks again! Michael On Thu, 1 Feb 2001, Jason Murray wrote: I am writing a script that will send me an email every time a 404 error is returned for an http request. So far I have the script working so that it will email me and inform me of the URL of the page that has the offending link by using the HTTP_REFERER environment variable. I would also like to find out what the requested page URL is. I have checked phpinfo() for info on other Apache enviro variables, but can't seem to find anything that would work. How can I do this? Is it possible? Sure - $REQUEST_URI is what you're looking for. Example of its use: http://www.inww.com/typesomecrapinhere :) Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] 404 error checker
John, I had the same problem, but it was a matter of how I was refering the teh 404 file in htaccess. It is working fine for me now. An example of my output is below. I wish I knew more about appache and htaccess to help you out, but I don't. michael WEBSITE-- www.social-ecology.org BAD LINK-- http://www.social-ecology.org/new/indexbog.html PAGE WITH BAD LINK-- http://www.social-ecology.org/indexbogus.html TYPE-- 404 File Not Found WHO WAS ACCESSING-- ch5blm.bellglobal.com USER AGENT Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; CNETHomeBuild051099; DigExt) On Thu, 1 Feb 2001, John Huggins wrote: After some experimenting I find this 404.php program only shows the original missing file when the .htaccess file has the "ErrorDocument 404 /404.php" phrase. One might assume that putting this directly into the httpd.conf file of the Apache server would perform the same thing. Indeed, the value of where the link came from does survive, but the value of the missing file is always 404.php, not the actual missing page. Strange. Jason, Thanks for the pointer. Worked like a charm, well almost. I had to tweak my .htaccess file as it was messing up some global variables cause i was using absolute URLS to point to my error script. Someone else ask to see the script. You can check it at: http://www.social-ecology.org/404.txt The top part of the script actually does all the funky passing of error info to a selected email, and the bottom part is the page that is displayed upon a 404 error. You'll have to mess with your .htaccess so it looks something like this: ErrorDocument 404 /404.php Thanks again! Michael On Thu, 1 Feb 2001, Jason Murray wrote: I am writing a script that will send me an email every time a 404 error is returned for an http request. So far I have the script working so that it will email me and inform me of the URL of the page that has the offending link by using the HTTP_REFERER environment variable. I would also like to find out what the requested page URL is. I have checked phpinfo() for info on other Apache enviro variables, but can't seem to find anything that would work. How can I do this? Is it possible? Sure - $REQUEST_URI is what you're looking for. Example of its use: http://www.inww.com/typesomecrapinhere :) Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] 404 error checker
Ah yes, this seems to stem from the fact the "ErrorDocument 404 /404.php" is really a kind if redirect. What's weird about this is if you use it one way (in the .htaccess) the PHP variables that appear are pre-redirect. If you put "Errordocument 404 /404.php" into the httpd.conf the PHP variables are post-redirect and are just as if you went straight to the 404.php page. I am sure I am missing some kind of Apache "point-of-view," but is it working for most of my URLs now. Some ancient CGI accesses come in now and again and they show this problem. However, thanks for the idea and code. Even as just a 404 trigger, this is very useful. The emails are starting to show just how many old URLs exist on my servers. John -Original Message- From: Institute for Social Ecology [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 01, 2001 2:32 PM To: John Huggins Cc: [EMAIL PROTECTED] Subject: RE: [PHP] 404 error checker John, I had the same problem, but it was a matter of how I was refering the teh 404 file in htaccess. It is working fine for me now. An example of my output is below. I wish I knew more about appache and htaccess to help you out, but I don't. michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] 404 error checker
After some experimenting I find this 404.php program only shows the original missing file when the .htaccess file has the "ErrorDocument 404 /404.php" phrase. One might assume that putting this directly into the httpd.conf file of the Apache server would perform the same thing. Indeed, the value of where the link came from does survive, but the value of the missing file is always 404.php, not the actual missing page. Strange. Jason, Thanks for the pointer. Worked like a charm, well almost. I had to tweak my .htaccess file as it was messing up some global variables cause i was using absolute URLS to point to my error script. Someone else ask to see the script. You can check it at: http://www.social-ecology.org/404.txt The top part of the script actually does all the funky passing of error info to a selected email, and the bottom part is the page that is displayed upon a 404 error. You'll have to mess with your .htaccess so it looks something like this: ErrorDocument 404 /404.php Thanks again! Michael On Thu, 1 Feb 2001, Jason Murray wrote: I am writing a script that will send me an email every time a 404 error is returned for an http request. So far I have the script working so that it will email me and inform me of the URL of the page that has the offending link by using the HTTP_REFERER environment variable. I would also like to find out what the requested page URL is. I have checked phpinfo() for info on other Apache enviro variables, but can't seem to find anything that would work. How can I do this? Is it possible? Sure - $REQUEST_URI is what you're looking for. Example of its use: http://www.inww.com/typesomecrapinhere :) Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] 404 error checker
You may be getting emails, but for some reason, when I try the links provided as a demo: BAD LINK-- http://www.social-ecology.org/new/indexbog.html PAGE WITH BAD LINK-- http://www.social-ecology.org/indexbogus.html My browser pops up the save as dialog. I do have javascript enabled, so I don't understand it. I have been working on a similar 404 - actually just trying to modify the one at phpbuilder.com to work with my system (PHP mail() won't work because user nobody does not have permissions to execute the deliver daemon in the Cyrus Imap server). Are you seeing the page itself? I can't bring it up. Lou John Huggins wrote: Ah yes, this seems to stem from the fact the "ErrorDocument 404 /404.php" is really a kind if redirect. What's weird about this is if you use it one way (in the .htaccess) the PHP variables that appear are pre-redirect. If you put "Errordocument 404 /404.php" into the httpd.conf the PHP variables are post-redirect and are just as if you went straight to the 404.php page. I am sure I am missing some kind of Apache "point-of-view," but is it working for most of my URLs now. Some ancient CGI accesses come in now and again and they show this problem. However, thanks for the idea and code. Even as just a 404 trigger, this is very useful. The emails are starting to show just how many old URLs exist on my servers. John -Original Message- From: Institute for Social Ecology [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 01, 2001 2:32 PM To: John Huggins Cc: [EMAIL PROTECTED] Subject: RE: [PHP] 404 error checker John, I had the same problem, but it was a matter of how I was refering the teh 404 file in htaccess. It is working fine for me now. An example of my output is below. I wish I knew more about appache and htaccess to help you out, but I don't. michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Louis LeBlanc Fully Funded Hobbyist, KeySlapper Extrordinaire :) [EMAIL PROTECTED] http://acadia.ne.mediaone.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] 404 error checker
I am writing a script that will send me an email every time a 404 error is returned for an http request. So far I have the script working so that it will email me and inform me of the URL of the page that has the offending link by using the HTTP_REFERER environment variable. I would also like to find out what the requested page URL is. I have checked phpinfo() for info on other Apache enviro variables, but can't seem to find anything that would work. How can I do this? Is it possible? Sure - $REQUEST_URI is what you're looking for. Example of its use: http://www.inww.com/typesomecrapinhere :) Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]