Results 1 to 2 of 2

Thread: .htaccess file

  1. #1

    .htaccess file

    Have a problem with a clients site and hotlinking, bandwidth gone through the the roof. I tried to edit the .htaccess file but no joy. What happens after I edit the .htaccess file is that access to files listed in .htaccess is blocked to everyone not just the sites hotlinking.

    Cos of new user posting restrictions here I cant list all the .htaccess file only these lines.

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !=""
    RewriteCond %{HTTP_REFERER} "!^domain/.*$" [NC]
    RewriteCond %{REQUEST_URI} "\.(gif|jpg|jpeg|bmp|swf|wav|mpeg|avi)$"
    RewriteRule .* - [F]

    The word domain in the .htaccess file is replaced with the clients full domain name.

    Hope someone out there can help me sort this out as I might have to pull the site if I can't solve the hotlinking problem.

    Thanks

    Bobbybean

  2. #2
    Join Date
    Feb 2003
    Location
    Singapore
    Posts
    240

    Re: .htaccess file

    Originally posted by bobbybean
    Have a problem with a clients site and hotlinking, bandwidth gone through the the roof. I tried to edit the .htaccess file but no joy. What happens after I edit the .htaccess file is that access to files listed in .htaccess is blocked to everyone not just the sites hotlinking.

    Cos of new user posting restrictions here I cant list all the .htaccess file only these lines.

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !=""
    RewriteCond %{HTTP_REFERER} "!^domain/.*$" [NC]
    RewriteCond %{REQUEST_URI} "\.(gif|jpg|jpeg|bmp|swf|wav|mpeg|avi)$"
    RewriteRule .* - [F]

    The word domain in the .htaccess file is replaced with the clients full domain name.

    Hope someone out there can help me sort this out as I might have to pull the site if I can't solve the hotlinking problem.

    Thanks

    Bobbybean
    try this, it will works :

    Code:
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://([a-z0-9-]+\.)*yourdomain.com* [NC]
    RewriteRule /* http://www.yourdomain.com/hotlinkdisabled.gif [R,L]
    under [R,L] u can place an image in replace of files

    [NC] is your domain


    place this .htaccess into the folder storing your files.
    Last edited by d3nnis; 05-06-2004 at 12:26 AM.

Posting Permissions

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