Originally Posted by JAISP
I personally edited out that as people were using it to host photo's on my site then displaying them on others sites stealing my bandwidth.
Well, with some .htaccess magic you could do a couple of things as well...

1. Allow linking but define sites allowed to do so.
2. Redirect "unauthorized" linking to another file which will load in its place (feel free to get creative here).

This is what i use:
Code
# Allow authorized sites to retrieve files. #
RewriteCond %{HTTP_REFERER} !^$

# Start UGN Specific Hosts #
RewriteCond %{HTTP_REFERER} !65.19.133.34 [NC]
RewriteCond %{HTTP_REFERER} !65.19.133.39 [NC]
RewriteCond %{HTTP_REFERER} !undergroundnews.com [NC]
RewriteCond %{HTTP_REFERER} !undergroundnews.net [NC]
RewriteCond %{HTTP_REFERER} !undergroundnews.org [NC]
RewriteCond %{HTTP_REFERER} !ugnsecurity.com [NC]

# Start Affiliate Hosts #
RewriteCond %{HTTP_REFERER} !ubbdev.com [NC]
RewriteCond %{HTTP_REFERER} !ubbcentral.com [NC]
RewriteCond %{HTTP_REFERER} !home.corthell.net [NC]
RewriteCond %{HTTP_REFERER} !virtualnightclub.net [NC]

# Start Search Engine Hosts #
RewriteCond %{HTTP_REFERER} !google.com [NC]
RewriteCond %{HTTP_REFERER} !yahoo.com [NC]
RewriteCond %{HTTP_REFERER} !picsearch.com [NC]
RewriteCond %{HTTP_REFERER} !^http://aolsearch.aol.com [NC]

# Start defined files & redirect location #
RewriteRule [^/]+.(exe|com|swf|fla|mp3|mov|wmv|rm|ram|wma|zip|txt|bat|tar|rar|gz|tgz|gif|jpg|jpeg|psd|png)$ - [F]

Basiclly, the rewritecond's for the referrer are domains you wish to allow, then the rule between the ()'s are the type of files, and the - at the end of the rule is where you'd put the file to load (or - for none).

So for images only, just leave gif|jpg|jpeg|psd|png then set the - to a full url of an image of your choosing (say a big banner saying "Stop stealing our bandwidth" tongue...

You'd ofcoarse want to add any domain that can access your files from your site (like i did in section 1) tongue

Oh, and the search engine bit there still lets search engines troll your site and display images, but that's for more of a method of gaining incoming users so they can still see graphics.

Last edited by Gizmo; 04/16/2009 9:29 AM.

I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!