WhiteKnight77 1 Posted July 5, 2004 Share Posted July 5, 2004 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. Quote Link to post Share on other sites
Dannik 43 Posted July 5, 2004 Share Posted July 5, 2004 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. Quote Link to post Share on other sites
WhiteKnight77 1 Posted July 5, 2004 Author Share Posted July 5, 2004 Where would that file go? Does it get uploaded to the main website directory? Quote Link to post Share on other sites
Dannik 43 Posted July 5, 2004 Share Posted July 5, 2004 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'. Quote Link to post Share on other sites
magnumkp 0 Posted July 5, 2004 Share Posted July 5, 2004 This link might help: http://www.htmlbasix.com/disablehotlinking.shtml Quote Link to post Share on other sites
Dannik 43 Posted July 5, 2004 Share Posted July 5, 2004 It can't get any easier than that link. Quote Link to post Share on other sites
WhiteKnight77 1 Posted July 5, 2004 Author Share Posted July 5, 2004 I had already copy and pasted what was posted here to Notepad already. I did find that link very useful though and bookmarked it. Thanks guys. Quote Link to post Share on other sites
Dannik 43 Posted July 5, 2004 Share Posted July 5, 2004 Looks like the .htaccess file on your site needs tweaking. It's currently forbidding your own site from displaying the images. Quote Link to post Share on other sites
WhiteKnight77 1 Posted July 5, 2004 Author Share Posted July 5, 2004 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] Quote Link to post Share on other sites
WhiteKnight77 1 Posted July 5, 2004 Author Share Posted July 5, 2004 I got it. I had to actually add my website to the list and removing the /images/ directory. If anyone else has trouble seeing pics let me know. Quote Link to post Share on other sites
Dannik 43 Posted July 5, 2004 Share Posted July 5, 2004 Looking good, WK. Now only on sites you visit can people leech your bandwidth. Quote Link to post Share on other sites
WhiteKnight77 1 Posted July 5, 2004 Author Share Posted July 5, 2004 I don't mind sharing some, I will even host files for people. I do try to host pics myself verses use someone elses bandwidth. now I don't have to do this: Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.