View Single Post

  #5 (permalink)  
Old 12-12-2003
Michel
 
Posts: n/a
Default Re: [Q] Block all incoming visitors from a referrer domain?

Uhm..... just excuse me for a sec....

Some guys is sending you traffic and you want to block it?

Doesn't make very much sense...

Michel

"Sir Loin of Beef" <NOSPAMmdknight@pacific.net.sg> wrote in message
news:3fd9a907.48119279@news.starhub.net.sg...
> Some guy on another site has placed a link to my site on his, and
> overnight my bandwidth usage shot up by 1 gb.
>
> How can I block all visitors coming to my site from his? What options
> do I have? Is htaccess the only way? How would I go about it?
>
> I have found the following php code. However, besides redirecting the
> browser, as in header("Location: http://www.idontlikeyou.net/"); what
> other options are open to me? Can I just halt loading of the page, or
> return a blank page instead of redirecting?
>
>
>
> <?php
> // simple referer check
>
> // check is referrer exists
> if ($HTTP_REFERRER){
> // check if the referrer is on your noentry list
> // if so redirect it to another page
> if ($HTTP_REFERRER == www.katoots.com) {
> header("Location: http://www.idontlikeyou.net/");
> exit;
> }
> // shows the referrer and formats ur local harddrive
> echo "You came from $HTTP_REFERRER";
> }
> ?>
>
>
> In addition, the above code only looks at 1 referrer. How can I block
> entry from multiple referrers?
>
> Thanks.



Reply With Quote