Results 1 to 2 of 2

Thread: htaccess allow & deny refer

  1. #1
    Join Date
    Sep 2006
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default htaccess allow & deny refer

    Please help me config the htaccess file so it will deny access from all (include typing the url in the address bar) unless it was refer from a specific site (link was click from a specific site i.e. xya123.com)

    this is the current content in .htaccess

    <Files *.mfh>
    order allow,deny
    deny from all
    </Files>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^/]+)/?$ download.php?file=$1 [L]

    I change it to:

    <Files *.mfh>
    order allow,deny
    deny from all
    allow from xya123.com
    </Files>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^/]+)/?$ download.php?file=$1 [L]

    or

    <Files *.mfh>
    order allow,deny
    deny from all
    allow from ip address
    </Files>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^/]+)/?$ download.php?file=$1 [L]

    but it didn't work, please help

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    have a look here for some tips and help with specifics.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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