Jump to content
Ghost Recon.net Forums

Limiting Hotlinking of Images


Recommended Posts

Most of you already know that I found a guy leaching my bandwidth and me substituting a pic that was different from what he wanted.

What if any code can be written to stop bandwidth theives or how does one have a different image show instead?

I do want to be able to link to the images myself (one reason why I have my own website), yet keep others from doing so without my express permission.

Link to post
Share on other sites

The most basic method is via .htaccess

Create a plain text file containing:

    RewriteEngine On
   RewriteCond %{HTTP_REFERER} !^http://www.yoursite.com [NC]
   RewriteCond %{HTTP_REFERER} !^http://yoursite.com [NC]
   RewriteCond %{HTTP_REFERER} !^http://www.yoursite2.com [NC]
   RewriteCond %{HTTP_REFERER} !^http://yoursite2.com [NC]
   RewriteRule [^/]+.(gif|jpg)$ - [F][/code]

Replace each url with the urls of sites that it is allowable to pull images from servers (as in, if you post images in four forums regularly, set them up, and add any others as you find yourself posting to them).

This will not prevent folks on the permitted domains from leeching from you, but there is no simple way of permitting yourself access without permitting others at the same sites.

There is a way to script (via php, for example) to prevent any access by exterior sites, but that would defeat your desire to repost yourself.

Link to post
Share on other sites

You save it as something like 'htaccess.txt' and upload it to your root html folder, unless your host specifies a different directory. Then you need to rename it to '.htaccess'.

Link to post
Share on other sites

I know, I can show stuff on other sites, but not there. Any ideas?

RewriteEngine On

   RewriteCond %{HTTP_REFERER} !^http://whiteknight77.net/images/ [NC]

   RewriteCond %{HTTP_REFERER} !^http://www.whiteknight77.net/images/ [NC]

   RewriteCond %{HTTP_REFERER} !^http://www.ghostrecon.net [NC]

   RewriteCond %{HTTP_REFERER} !^http://ghostrecon.net [NC]

   RewriteCond %{HTTP_REFERER} !^http://www.agr-s.com [NC]

   RewriteCond %{HTTP_REFERER} !^http://agr-s.com [NC]

   RewriteCond %{HTTP_REFERER} !^http://www.military.com [NC]

   RewriteCond %{HTTP_REFERER} !^http://forums.military.com [NC]

   RewriteCond %{HTTP_REFERER} !^http://www.ubi.com [NC]

   RewriteCond %{HTTP_REFERER} !^http://ubi.com [NC]

   RewriteCond %{HTTP_REFERER} !^http://www.ghostrecon.net/forums/ [NC]

   RewriteCond %{HTTP_REFERER} !^http://ubbxforums.ubi.com/6/ubb.x [NC]

   RewriteCond %{HTTP_REFERER} !^http://www.forumplanet.com/gamespy/ [NC]

   RewriteCond %{HTTP_REFERER} !^http://www.forumplanet.com/planethardware/ 


[NC]

   RewriteCond %{HTTP_REFERER} !^http://www.agr-s.com/forums/ [NC]

   RewriteCond %{HTTP_REFERER} !^http://www.tactical_elite.net/forums/ [NC]

   RewriteRule [^/]+.(gif|jpg)$ - [F]

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...