View Single Post
Old 08-07-2021, 12:10 AM  
hausarzt
Confirmed User
 
hausarzt's Avatar
 
Industry Role:
Join Date: Jan 2011
Location: Somewhere in Germany
Posts: 817
Prevent hotlinking with htaccess doesn't work

Hey guys.
A bunch of sites hotlink my media, so I wanted to prevent it with some htaccess code.
I use wordpress, so there is a bunch of other stuff in the file. I only post the stuff I added:

Code:
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(www\.)?website1\.com(/.*)*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?website2\.com(/.*)*$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?website3\.com(/.*)*$ [NC,OR]
RewriteRule \.(jpeg|JPEG|jpe|JPE|jpg|JPG|gif|GIF|png|PNG|mng|MNG)$ - [F]
Somehow this does not work, as the media is still present on the external sites. What's wrong with my code?
__________________
I know, my english is bad. But your german might be even worse
hausarzt is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote