+ Reply to Thread
Results 1 to 5 of 5

Thread: Redirect troubles

  1. #1
    Join Date
    Aug 2007
    Posts
    19

    Default Redirect troubles

    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:
    PHP Code:
    <?php

    $ban
    []="badsite1.com";
    $ban[]="badsite2.com";

    $isban=false;

    foreach (
    $ban as $key => $ref):
             if ( 
    strpos($_SERVER['HTTP_REFERER'], $ref)!=):
                  
    header ("Location:http://www.mysite.com/exit.html");
                  
    $isban=true;
                  break;
             endif;
    endforeach;

    if (!
    $isban)
    {
      
    header ("Location:http://mysite.com/download/$id");
    }

    ?>
    2) And the htaccess file which contains:
    Code:
    RewriteEngine on
    RewriteRule ^setup.exe$ download.php?$1&id=setup-new.exe
    Redirect is works fine, bad user is redirected to http://www.mysite.com/exit.html
    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.

  2. #2
    Join Date
    Aug 2007
    Posts
    19

    Default

    Please help!

  3. #3

    Post

    Hi,

    there was another comment very similar to yours here on the forum. search for .exe - it was something in his .htaccess code that had /exe at the end of a line of code. I can't remember what it was. Try looking only at new posts and you should be able to find it.

    Good luck,
    GOD BLESS,
    Beti
    http://vetstribute.com
    SUPPORT OUR TROOPS! Remember our Veterans!

  4. #4

    Default

    Quote Originally Posted by betiryan View Post
    Hi,

    there was another comment very similar to yours here on the forum. search for .exe - it was something in his .htaccess code that had /exe at the end of a line of code. I can't remember what it was. Try looking only at new posts and you should be able to find it.

    Good luck,
    GOD BLESS,
    Beti
    http://vetstribute.com
    ha! found it ->
    # deny most common except .php/.html
    <FilesMatch "\.(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd |the me|module|exe)$">
    deny from all
    </FilesMatch>

    That little exe on the end of the line ....... simple but deadly !!
    SUPPORT OUR TROOPS! Remember our Veterans!

  5. #5
    Join Date
    Aug 2007
    Posts
    19

    Default

    Thank you.
    But I don't need deny from all, I need redirect from bad sites only, and allow to good sites.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts