Results 1 to 3 of 3
-
8th Jan 2011, 07:57 AM #1OPMember
How to block referring website?
Do you guys know how to block users coming from a specific website? I'm trying to figure out if there's an option in cpanel to put in the referrer to block but I cant see that option :/ I've tried to edit htaccess but it wont work, any ideas?
masterb56 Reviewed by masterb56 on . How to block referring website? Do you guys know how to block users coming from a specific website? I'm trying to figure out if there's an option in cpanel to put in the referrer to block but I cant see that option :/ I've tried to edit htaccess but it wont work, any ideas? :( Rating: 5
-
8th Jan 2011, 08:20 AM #2It begins...
Here's a basic code outline. You can modify it to suit yourself.
Code:RewriteEngine On RewriteCond %{HTTP_REFERER} ^http://(.+\.)?127.0.0.1/ [NC,OR] # This rule blocks a visitor originating from an IP RewriteCond %{HTTP_REFERER} ^http://(.+\.)?sampledomain\.info/ [NC] # This one blocks any visitor originating from sampledomain.info or *.sampledomain.info (subdomain) RewriteRule .*\.(jpg|gif|bmp|png)$ http://example.com/nohotlink.jpg [L] # This rule will redirect all requests to the images from the above referrers to an error image (or document/page). RewriteRule .* http://sample.com/blocked.html [L] #This rule redirects a request for everything (images, files, web pages) to an error page/image.
What's important is that the last line blocks requests to everything on the server. So if you were to redirect the blocked user to a page or anything on the same server informing them that they were blocked, it'd result in an endless loop and a possible timeout. Not a very handy solution. In my opinion, a more suitable option would be to redirect them to a different domain with a blocked message and/or to their localhost (if you're feeling evil).
Having said that, remember that referrer based blocking is not fool proof. Some browsers often remove the referrer. Some antiviruses/antispywares and security programs also do that. This is done to effectively enhance the surfer's security. Some websites fake the referrer too, or remove it altogether.
The likelihood of the above, though, is generally low. A very small % of the users have their referrer removed. So if a domain is abusing your server resources, by say, hotlinking to an image, the above code (expansible, of course) is a very neat way to bring it down by a lot.
An example? I use the above code (constructed differently) to block a few domains that hotlink to abuse images on my site. And I save hundreds of gigs on bandwidth and lots of time I would otherwise spend tweaking my server to handle all the hotlink requests.
-
8th Jan 2011, 10:38 AM #3OPMember
Thank you very much lifetalk
Actually I just want to derail some users coming from a specific site (where my site is hotlinked) I think I've tried RewriteCond but I'll try again, I was testing it on myself and modified the referer but it would not work, when I did itI'll try your technique
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
FastCashMega EARN 300% quick without referring
By denask in forum Webmasters, Money MakingReplies: 6Last Post: 21st Jan 2012, 11:03 PM -
[Other] [Get PAID $1.10 for Referring][1GBit OffShore] RapidLeech by SimpleLeech [25GB @10$]
By kundurocks in forum ArchiveReplies: 254Last Post: 17th Feb 2011, 05:08 PM -
How to block pop ups-Need help
By sasacal in forum Tutorials and GuidesReplies: 7Last Post: 9th Oct 2010, 10:07 PM -
Earn $$ just for Referring..... A New Forum......
By ragav.bpl in forum Forum and DDL DiscussionReplies: 2Last Post: 27th Mar 2009, 10:35 AM
themaLeecher - leech and manage...
Version 5.05 released. Open older version (or...