GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Prevent hotlinking with htaccess doesn't work (https://gfy.com/showthread.php?t=1347220)

hausarzt 08-07-2021 12:10 AM

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?

bugmenot4real 08-07-2021 12:39 AM

cache? maybe?

doeser 08-07-2021 01:46 AM

nginx maybe?

JesseQuinn 08-07-2021 02:27 AM

Quote:

Originally Posted by hausarzt (Post 22896690)
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

Major (Tom) 08-07-2021 03:51 AM

Link Hotten!

Freedom6995 08-07-2021 05:29 AM

https perhaps instead of http?

plsureking 08-07-2021 09:20 AM

more of a !not instead of do. i dont think you want to update your htaccess every time a new asshole starts hotlinking. if the ref is NOT your site, redirect.

https://help.dreamhost.com/hc/en-us/...ge-hotlinking-

and watch those mng files :1orglaugh

#


All times are GMT -7. The time now is 03:09 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc