in reply to Re: blocking naughty referrers
in thread blocking naughty referrers

Very close, except that you spelled "referrer" correctly, and HTTP doesn't. Fleshed out a bit more, this looks like
#!/usr/bin/perl if ( defined $ENV{'HTTP_REFERER'} and $ENV{'HTTP_REFERER'} =~ /dumdomain\.com/ ) { print "Location: http://www.anotherpage.com\n\n"; exit(0); } print "Content-type: text/html\n\n"; ...

Replies are listed 'Best First'.
Re: Re: Re: blocking naughty referrers
by snafu (Chaplain) on May 14, 2001 at 19:38 UTC
    Ahh, thank you! I also noticed that I did not escape my '.' in my RE. I wonder what I was thinking.

    ----------
    - Jim

Re: Re: Re: blocking naughty referrers
by mishko (Initiate) on May 15, 2001 at 05:09 UTC
    ok i tried this version because i didn't want to send people back to where they came from, but instead a more *constructive* site.

    unfortunately i'm still getting "an error occurred while processing this directive". yuck.

    any ideas?

      unfortunately i'm still getting "an error occurred while processing this directive".

      I hope you didn't take the "<code>...<code>" in my example literally. :)

      For hints on debugging CGIs, see CGI Programming.