I am owner of shareware website.
I just trying to redirect all users who want to download my software from warez sites by direct link.
For this purpose I put two files into download directory.
1) download.php which contains:
2) And the htaccess file which contains:PHP Code:<?php
$ban[]="badsite1.com";
$ban[]="badsite2.com";
$isban=false;
foreach ($ban as $key => $ref):
if ( strpos($_SERVER['HTTP_REFERER'], $ref)!=0 ):
header ("Location:http://www.mysite.com/exit.html");
$isban=true;
break;
endif;
endforeach;
if (!$isban)
{
header ("Location:http://mysite.com/download/$id");
}
?>
Redirect is works fine, bad user is redirected to http://www.mysite.com/exit.htmlCode:RewriteEngine on RewriteRule ^setup.exe$ download.php?$1&id=setup-new.exe
But normal user is redirected to http://mysite.com/download/ instead of http://mysite.com/download/setup-new.exe
When I used my previous hosting provider I have no problem like this. Please help.


Reply With Quote

