Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 08-07-2021, 12:10 AM   #1
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
Old 08-07-2021, 12:39 AM   #2
bugmenot4real
Confirmed User
 
bugmenot4real's Avatar
 
Industry Role:
Join Date: Jun 2013
Location: Canada
Posts: 184
cache? maybe?
__________________
bugmenot4real is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-07-2021, 01:46 AM   #3
doeser
Confirmed User
 
Join Date: Jun 2001
Location: swiss alps
Posts: 205
nginx maybe?
doeser is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-07-2021, 02:27 AM   #4
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
Old 08-07-2021, 03:51 AM   #5
Major (Tom)
Anti Communist
 
Major (Tom)'s Avatar
 
Industry Role:
Join Date: Nov 2003
Location: Null
Posts: 29,750
Link Hotten!
__________________
My mother said, to get things done
You'd better not mess with Major Tom
Major (Tom) is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-07-2021, 05:29 AM   #6
Freedom6995
Friends of Venus founder
 
Freedom6995's Avatar
 
Industry Role:
Join Date: Jul 2010
Posts: 1,964
https perhaps instead of http?
__________________
Email: freedom6995 . protonmail.com
Freedom6995 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-07-2021, 09:20 AM   #7
plsureking
bored
 
plsureking's Avatar
 
Industry Role:
Join Date: Aug 2003
Location: Metaverse
Posts: 4,675
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

#
__________________
#
plsureking is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
[nc, or], rewritecond, %http_referer, media, code, prevent, stuff, htaccess, bunch, sites, [f], rewriterule, hotlinking, wrong, external, rewriteengine, wordpress, guys, post, added, hotlink, file, hey



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.