# Prevent image hotlinking - don't steal my bandwidth # source http://www.alistapart.com/articles/hotlinking # # [NC] -> No Case which means that an uppercase letter is the same as a lowercase letter # # RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC] -> Is the file that is being requested end with jpg, gif, or png # # RewriteCond %{HTTP_REFERER} !^$ -> Is the referering site not blank, if someone opens there browser and types your image location file in the browser # # RewriteCond %{HTTP_REFERER} !yoursite\.com [NC] -> Is the referering site not your own website, without this then your own webpages will not have images # # RewriteCond %{HTTP_REFERER} !friendlysite\.com [NC] -> You can also set other sites that should have access to do so # # RewriteCond %{HTTP_REFERER} !google\. [NC] -> Site is not google, often you will want google to get through # # RewriteRule (.*) - [F,NC] -> Any request that passed ALL the test will be redirected to nothing '-' RewriteEngine On RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !yoursite\.com [NC] RewriteCond %{HTTP_REFERER} !friendlysite\.com [NC] RewriteCond %{HTTP_REFERER} !google\. [NC] RewriteCond %{HTTP_REFERER} !search\?q=cache [NC] RewriteRule (.*) - [F,NC]