PDA

View Full Version : Custom 404 script


Charl
11-09-2002, 09:46 PM
Hello,:(

I am trying to get this script to work on my server, i have cgi access and all permissions for files and folders but i cant for the life of me see whats wrong. I have read all the instructions and carried them out to the T.

The code as i have configured it. I have only changed the part in bold. As stated on the Readme.txt
[SIZE=1]
#!/usr/local/bin/perl
#######################################################################
# (c) 2001 by Michael May M&M Error Director v1.3
# tmaster@bigfoot.com
# http://webmasters.winnfreenet.com Check with website before using
#
#######################################################################

# Email to send a report to
$email = 'charlatanz@hushmail.com';

# Email report will be sent from
$fmail = 'websiterror@hotmail.com';

# Enter a name for this website
$identify = "Charlatanz - Maximum";

# Path to your cgi directory.
# hypermart = /data1/hypermart.net/USERNAME/cgi-bin
# virtualave= /data1/virtualave.net/USERNAME/public_html/cgi-bin
# portland = /home/USERNAME/cgi-bin
#
$logpath = "ivdrip.com/charlatanz/cgi-bin";
$errorpath = "ivdrip.com/charlatanz/error";

# URL directory where your error pages are stored
$url_path = "http://www.ivdrip.com/charlatanz/error";

# Send mail search system. All of the listed paths will be checked for sendmail
# The first one that does not give a error will be used.
# If you know your sendmail path enter it on the first $mailer line.

$mailer = '/var/qmail/bin/qmail-inject';

$mailer1 = '/usr/sbin/sendmail';
$mailer2 = '/usr/lib/sendmail';
$mailer3 = '/usr/bin/sendmail';
$mailer4 = '/bin/sendmail';

$error401 = "401.html";
$error403 = "403.html";
$error404 = "404.html";
$error500 = "500.html";
$error000 = "hack.html";

# Full detailed logging 1=on 0=off
$detail = '1';
# How many errors to save before sening email & reset
$rcount = "100";

# Email 1=on 0=off
$send_mail = "0";

MCookie
11-10-2002, 10:52 AM
# Email to send a report to
$email = 'charlatanz@hushmail.com';

# Email report will be sent from
$fmail = 'websiterror@hotmail.com';

In the original script are slashes to escape the @ sign. I wonder if those shouldn't be backslashes. But you could give it a try.

charlatanz/@hushmail.com
websiterror/@hotmail.com

Charl
11-10-2002, 06:25 PM
MCookie ive added in the instructions ive followed, what i'm going to do is try and get the custom error page working then set up the option of being mailed if someone clicks a dead link.

So far ive turned the option off

# Email 1=on 0=off
$send_mail = "0";

Charl
11-12-2002, 04:14 PM
I had to use another script in the end, its not as good as the original but you can tweak it.

http://www.ivdrip.com/charlatanz/404manager.zip

Grizz2
11-12-2002, 07:41 PM
MCookie is right. You will need to backslash the @ or perl will think its an array.
This should be giving you a 500 server error.

$fmail = 'websiterror\@hotmail.com';

Grizz

Mouldy_Goat
11-14-2002, 12:41 AM
Just to clarify... this:
$string = 'foo@bar.com';
is fine, and will not even raise a warning since it is in single quotes. This, on the other hand:
$string = "foo@bar.com";
is wrong, and will raise an exception, causing execution of the script to terminate. This is because with double quotes, there is an ambiguity in that the user may or may not want the '@' sign to be interpreted as an array to be interpolated.