Re: .htaccess and hotlinking question/problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dec 22, 2007 8:18 PM, Techman <techman@xxxxxxxxxx> wrote:
>
> I have read about a hundred pages on hotlinking today and I have been trying
> to implement an .htaccess file to prevent it, but so far nothing is working.
>
> I am using Slackware Linux 10 and Apache 1.3.36.
>
> What I want to do is stop people from directly downloading from my DL
> directory.
>
> i.e. www.mysite.com/download/myfile.avi
>
> If they type in the above I want an error page displayed.
>
> Currently I have an .htaccess file in the root directory of my site, as
> follows.
>
>
> RewriteEngine on
> RewriteOptions inherit
>
> RewriteCond %{HTTP_REFERER}!^$
> RewriteCond %{HTTP_REFERER} !^http://www.mysite.ca/.*$ [NC]
> RewriteRule .*.(avi|AVI|mpg|MPG|wmv|WMV|swf|SWF)$ - [F]
>
> This is very simplistic, but I just want to get it working, then I can add
> other options or whatever.
>
> Any help on what I am doing wrong is appreciated, or any other solutions to
> stop direct downloading.

And what exactly is happening when you try that? What exactly do you
type in your browser and what do you see in your browser, you
access_log and your error_log. Finally, and most importantly, have you
used the RewriteLog in httpd.conf to see what mod_rewrite is seeing.
In general, mod_rewrite is easier to deal with in httpd.conf as well,
if you can avoid using .htaccess.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux