Date: Tue, 29 Apr 1997 23:43:01 +0200 From: Stefan.Bethke@Hanse.DE (Stefan Bethke) To: nsj@ncsu.edu, wosch@cs.tu-berlin.de (Wolfram Schneider) Cc: www@freebsd.org Subject: Re: foobar Message-ID: <v01540b01af8c19179b6d@[193.141.161.123]>
next in thread | raw e-mail | index | archive | help
At 15:54 Uhr 29.04.1997, Nate Johnson wrote: >%The message for unknown files does not look good, e.g. >%compare http://www.freebsd.com/foobar with http://www.att.com/foobar > >Good point. > >If someone (John? Jordan?) will configure Apache's srm.conf file with the >"ErrorDocument" tags, I'm willing to generate pages to handle the more common >errors (404, 500, etc.) I have a script at work which will automatically generate a mail for a 404 *if* the link the user was coming from comes from our own server (that is, we botched the link our selves). Obviously, it gives a somewhat nicer error page than the default. Below is the script I use at Promo. Stefan ------snip------- #!/bin/sh ERRORPAGE=/export/www/CGI-Daten/Fehlermeldungen/4xx.html if [ -z "$HTTP_REFERER" ]; then export msgde="Sorry, unter dieser URL k–nnen wir nichts anbieten. Sollten Sie die Adresse von Hand eingegeben haben, pr¸fen Sie bitte die Schreibweise.<P>" export msgen="Sorry, but we can't offer a document with this URL. Should you have entered the address manually, please check the spelling.<P>" else if echo $HTTP_REFERER | grep -iq '://www.promo.de/'; then export msgde="Oh, da ist uns ein Fehler unterlaufen! Unser Webmaster wird automatisch informiert.<P>" export msgen="Uh, we messed it up. Our Webmaster is notified automatically.<P>" if echo $REMOTE_HOST | grep -iq '.promo.de'; then ; else mail -s "Falscher Link auf unserer Seite" $SERVER_ADMIN <<EOF Auf unserer Seite $HTTP_REFERER ist ein Link auf $REDIRECT_URL Diese Seite existiert nicht (Fehler $REDIRECT_STATUS). Aufgerufen von $REMOTE_HOST [$REMOTE_ADDR]. -- (Automatisch generiert, ohne Unterschrift gueltig.) EOF fi else export msgde="Sorry, Sie sind einem veralteten Link gefolgt. Wenden Sie sich ggf. an den Administrator <A href=\"$HTTP_REFERER\">der verweisenden Seite</A>.<P>" export msgen="Sorry, you followed an outdated link. Please contact the administrator of <A href=\"$HTTP_REFERER\">the refering page</A>.<P>" fi fi echo "Content-Type: text/html" echo "" sh -c "echo \"`cat $ERRORPAGE`\"" -- Stefan Bethke <Stefan.Bethke@Hanse.DE> Hamburg, Germany
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?v01540b01af8c19179b6d>