vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=236)
-   -   Mini Mods - Stop Image Hotlinking! (https://vborg.vbsupport.ru/showthread.php?t=223918)

dxlwebs 09-24-2009 10:00 PM

Stop Image Hotlinking!
 
1 Attachment(s)
Hey all,

I thought that this might be usefull for you all its very simple and you can do it within 1 minute!

Basically all it does is stop people from hotlinking your images and using your bandwidth!

This code below allows your to stop hotlink for all sites apart from the sites you choose all you do is add this code your you .htaccess file!
Code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yoursite.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain2.com [NC]
RewriteRule .*\.(jpg|png|bmp|gif)$ http://yourdomain.com/forum/nhl.png [NC,R,L]

i have provided a image below for you to use if you would like other wise you can put your own image there, just chage the address of your site and location to your forum and add my image to your forum root and everytime some one trys to hotlink you they will only see that image!

thats it easy as pie! remember to back up your .htaccess file before editing anything!

dxlwebs 09-25-2009 07:01 AM

reserved for later comments

Arcade Fire 09-25-2009 07:31 AM

Thanks!

dxlwebs 09-25-2009 07:46 AM

your welcome

FiMeTi 09-25-2009 07:49 AM

Nice job, but with the second code it does not load any images on my own website.

Arcade Fire 09-25-2009 07:58 AM

Quote:

Originally Posted by FiMeTi (Post 1890329)
Nice job, but with the second code it does not load any images on my own website.


+1. :(

EidolonAH 09-25-2009 08:09 AM

I have been trying this here by previewing my post, doesn't work, my original image shows instead of my anti-hotlink image.

dxlwebs 09-25-2009 08:10 AM

i have changed the code try that it should work better now if you do not want a seconde domain then just delete that line!

Shogunreaper 09-25-2009 08:12 AM

You should just do this through your cpanel.

dxlwebs 09-25-2009 08:18 AM

and what if they dont have cpanel not everyone is rich you know

FiMeTi 09-25-2009 08:23 AM

Well that works, but I can´t get the deny.png to show. There´s just no image or a brokenlink-img. But it blocks other websites.

EidolonAH 09-25-2009 08:27 AM

Quote:

Originally Posted by FiMeTi (Post 1890345)
Well that works, but I can?t get the deny.png to show. There?s just no image or a brokenlink-img. But it blocks other websites.

can you post what you have in your .htaccess and where you put it that file, I can't get this to work myself.

FiMeTi 09-25-2009 08:32 AM

At the bottom of your .htaccess file you drop in this code.
Code:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?MYDOMAIN\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/misc/deny.png [L]

But the deny image does not pop up. Neither with this code, nor with the code of dxlwebs. ;/

dxlwebs 09-25-2009 08:32 AM

add this into your .htacces file in your forums root
Code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yoursite.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain2.com [NC]
RewriteRule .*\.(jpg|png|bmp|gif)$ http://yourdomain.com/forum/nhl.png [NC,R,L]

edit the links to your specified needs remember to put the correct links in and you must have your site url where i put yoursite.com to make sure that your sites images still show!

dxlwebs 09-25-2009 08:34 AM

Quote:

Originally Posted by FiMeTi (Post 1890349)
At the bottom of your .htaccess file you drop in this code.
Code:

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?MYDOMAIN\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://yoursite.com/images/misc/deny.png [L]

But the deny image does not pop up. Neither with this code, nor with the code of dxlwebs. ;/


your forgot to put your sites domain then the image socation i etided it in the quote take a look!

FiMeTi 09-25-2009 08:37 AM

Thanks mate, but I tried that surely, too. Still not working. Cache always empty before I test.
Anyway, this is still good enough. :)

dxlwebs 09-25-2009 08:40 AM

hmmm try putting www. before your domain if not then im stumped it should work!

Arcade Fire 09-25-2009 09:07 AM

Works, but not show alternative image.

I put one smile of my forum in Post #3 of this thread, but isn't sustitute for nhl.png image.

thedvs 09-25-2009 05:58 PM

this is mine which i have used for years, works great, use .gif for the deny picture!
Code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://.*websitename\.com.*$ [NC]
RewriteCond %{REQUEST_URI}  !^.*leech\.gif$ [NC]
RewriteRule ^.*\.(swf|bmp|gif|jpg|png|jpeg|avi|wmv|mpg|mpeg|wav|mp3)$ http://www.websitename.com/leech.gif [NC,R,L]


Arcade Fire 09-26-2009 08:09 AM

Thanks theadvs, woks fine!.

Example wen i put a icon of my forum:

http://rotolandia.com/images/icons/roto2cafe.gif

Shogunreaper 09-26-2009 08:16 AM

Quote:

Originally Posted by dxlwebs (Post 1890339)
and what if they dont have cpanel not everyone is rich you know

What kind of hosting does not have a cpanel lol?

EidolonAH 09-26-2009 09:09 AM

Quote:

Originally Posted by thedvs (Post 1890535)
this is mine which i have used for years, works great, use .gif for the deny picture!
Code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://.*websitename\.com.*$ [NC]
RewriteCond %{REQUEST_URI}  !^.*leech\.gif$ [NC]
RewriteRule ^.*\.(swf|bmp|gif|jpg|png|jpeg|avi|wmv|mpg|mpeg|wav|mp3)$ http://www.websitename.com/leech.gif [NC,R,L]


I got that in my .htaccess file like this:
HTML Code:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://.*nurturemh\.com.*$ [NC]
RewriteCond %{REQUEST_URI}  !^.*leech\.gif$ [NC]
RewriteRule ^.*\.(swf|bmp|gif|jpg|png|jpeg|avi|wmv|mpg|mpeg|wav|mp3)$ http://www.nurturemh.com/leech.gif [NC,R,L]

But it aint stopping the hotlinking (if it's working the image should be a nasty looking poo!)
*snip* nasty poo removed!

So what have I done wrong?

Arcade Fire 09-26-2009 09:13 AM

EidolonAH, woks fine for you, I see a poo :)

Delete cookies of your site, and you can see the diference.

EidolonAH 09-26-2009 09:19 AM

Quote:

Originally Posted by Arcade Fire (Post 1890755)
EidolonAH, woks fine for you, I see a poo :)

Delete cookies of vb.org, and you can see the diference.

Thanks Arcade Fire, I just saw, I removed the nasty poo image.:D

Robru 09-26-2009 05:40 PM

:):):)

princeedward 09-27-2009 06:37 AM

thanks for this....cant make it work...:(

here's my code

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://.*epaloids\.com.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*leech\.gif$ [NC]
RewriteRule ^.*\.(swf|bmp|gif|jpg|png|jpeg|avi|wmv|mpg|mpeg|wa v|mp3)$ http://www.epaloids.com/leech.gif [NC,R,L]

need help pls. thanks and best regards

EidolonAH 09-27-2009 04:15 PM

Quote:

Originally Posted by princeedward (Post 1891205)
thanks for this....cant make it work...:(

here's my code

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://.*epaloids\.com.*$ [NC]
RewriteCond %{REQUEST_URI} !^.*leech\.gif$ [NC]
RewriteRule ^.*\.(swf|bmp|gif|jpg|png|jpeg|avi|wmv|mpg|mpeg|wa v|mp3)$ http://www.epaloids.com/leech.gif [NC,R,L]

need help pls. thanks and best regards

https://vborg.vbsupport.ru/external/2009/09/1.gif <<< My Site Image

Give it a go from one of the smilies on your site or something like that, the image you are testing is hosted on photobucket, not your server. ;)

princeedward 09-27-2009 05:51 PM

Quote:

Originally Posted by EidolonAH (Post 1891367)
Give it a go from one of the smilies on your site or something like that, the image you are testing is hosted on photobucket, not your server. ;)

i guess got it now....

Mike08 10-05-2009 05:38 PM

what about google spiders?? Do not we must insert his url's in this code??

IRANCITY 10-05-2009 06:08 PM

Quote:

Originally Posted by Mike08 (Post 1895255)
what about google spiders?? Do not we must insert his url's in this code??

this is my question...
how can alow bot for save this pic and page ?

Mike08 10-06-2009 11:09 AM

I have read something about and many people insert the google's urls in this file.
But I'm not sure at 100%

segwayon 10-07-2009 01:20 PM

Where does the .htaccess file need to reside? I believe my server has a couple of them, so would the html_public folder block all images from all sub-folders?

shockspoon 10-08-2009 10:21 AM

Does this work for gallery images which are stored in the vb database and not in the filesystem?

Harley D 10-26-2009 02:02 PM

I need to go about this a bit differently...

Is it possible to only list the sites you want to block, rather than listing the sites you want to allow?

It would be alot easier for me to just block certain sites.

dxlwebs 10-26-2009 04:28 PM

basically with a bit of code changes it will do what you want but this is just to allow the sites that you write in there to be allowed as its designed to stop all other sites like google linking your site so no one reads your content they just steal your images!

oddmud 01-21-2010 01:14 PM

this works for all versions correct?

al2thero 12-02-2012 01:02 AM

Thanks a lot


All times are GMT. The time now is 05:55 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01298 seconds
  • Memory Usage 1,807KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (1)bbcode_html_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (37)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete