View Single Post
Old 08-07-2021, 02:27 AM  
JesseQuinn
feeding the wolves
 
JesseQuinn's Avatar
 
Industry Role:
Join Date: Aug 2012
Location: between sand and stars in Jamaica
Posts: 6,224
Quote:
Originally Posted by hausarzt View Post
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?
dunno about the code but since you're on wp you can use the WP Security plugin to block hotlinking pretty easily

hope that helps
JesseQuinn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote