Preventing Proxy Site Access

istarapol

Junior Member
Joined
Jun 3, 2008
Messages
121
Reaction score
233
Hi!

I'd like to know how to prevent proxy sites to access my blog/site.
I mean if a user uses proxy site like
Code:
www.atunnel.com
my site will deny the
connection or redirect this to another page. Using HTACCESS, php or perl

I've tried this on HTACCESS

Code:
order allow,deny
deny from *.atunnel.*
deny from 67.159.46.12
deny from 67.159.*.*
deny from ztunnel.com
allow from all

to no avail, I'm thinking a php will work for this process.

Can someone help?

Thanks in advance :)
 
Last edited:
Without trying it, you could do it in PHP:

PHP:
<?php
 $visitor = $_SERVER['REMOTE_ADDR']; 
 if(($visitor = "67.159.44.97") || ($visitor = "67.159.45.53"))
 {
    header("Location: http://where.you.want.proxy.user.to.go");
 }
 else
 {
    header("Location: http://your.real.page
 }
?>

There is a more elegant way of doing it as well if you want me to put it up later when I get 10 mins to get all the code sorted :)
 
hi fatboy.

Im getting an error

Warning: Cannot modify header information - headers already sent by (output started at /home/richjrk/public_html/*****/mryr/index.php on line 5
 
Are you printing anything else to the screen before you use that bit of code?

That just means that something is being sent to the display before my bit of code can redirect them.

I will be away for an hour or so but feel free to shout if you are still having probs
 
Im getting an error

Warning: Cannot modify header information - headers already sent by (output started at /home/richjrk/public_html/*****/mryr/index.php on line 5

Put a simple code at the top of the page :
Code:
<?php
ob_start();
?>
 
Just as a test - comment out the ob_start and then try it - does it work?
 
OK - give me some time this evening and I will actually code it up on my box to test it :)
 
remove every space before the "<?"
it's a well knowm bug
 
Back
Top