Apache rewrite_mod

Hi,
I really tried to figure this out on my own but I am helpless, and it's 3.50 am, so I am asking for help. I need to prevent people from including my images on their website. I don't care if they copy them, I just don't want to pay for the bandwidth.

I searched and was told that mod rewrite would work so I made this .htaccess file and placed on the images dir:

AuthUserFile /home/domain/.htpasswd
AuthGroupFile /dev/null
AuthName Password_Required
AuthType Basic
<Files admin.php>
<Limit GET POST>
require valid-user
</Limit>
</Files>

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com/images/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/images/.*$ [NC]
RewriteRule .*\.gif$ - [L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://domain.com/images/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.domain.com/images/.*$ [NC]
RewriteRule .*\.jpg$ -


Now I get a server error and the log file has this:
RewriteEngine not allowed here.

I even tried without the first part of the .htaccess (leaving only the rewrite lines)

I didn't do anything with the httpd.conf but I know that mod_rewrite is enabled because of the server headers. Can someone help?

I would really appreciate it, thanks

 

 

 

 

Top