-3

I have this snippet code in my .htaccess file to prevent users from hotlinking the server's images:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^$ [OR] 
RewriteCond %{HTTP_REFERER} !^http://(www.)?itransformer.es/.*$ [NC]
RewriteRule \.(gif|jpe?g|png|wbmp)$ http://itransformer.es [R,L]

Of course, it is not working in my localhost, but don't know how to achieve it. My guess is that I should change the domain name with any wildcard. Any idea?

Manolo
  • 562

1 Answers1

2
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^https?://%{HTTP_HOST}/.*$ [NC]
RewriteRule \.(gif|jpe?g|png|wbmp)$ %{HTTP_HOST} [R=404,L]
Chris S
  • 78,185
  • This question seems to be blocking my account. I've edited my question a few times but nothing changes. Could you please vote me up so I can ask more questions? Thanks in advance. – Manolo Mar 14 '14 at 08:03
  • It's not just this question, but also your other two with negative scores. You could contribute some positive Answers to other people's questions, once you get an upvote or two the ban will be automatically lifted. – Chris S Mar 14 '14 at 14:08
  • All right, but I don't see any other question with negative score... – Manolo Mar 14 '14 at 14:14
  • http://serverfault.com/questions/545821/unknown-processes-of-apache2 and http://serverfault.com/questions/532267/my-server-has-falled-over – Chris S Mar 14 '14 at 15:01
  • Oh! Thanks. I thought they were definitively removed. – Manolo Mar 14 '14 at 15:08