Disable Image Hotlinking - .htaccess

RewriteEngine on # Remove the following line if you want to block blank referrer too RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(.+\.)?yourdomain.com [NC] RewriteRule \.(jpg|jpeg|png|gif|bmp)$ - [NC,F,L] # If you want to display a "blocked" banner in place of the hotlinked image, # replace the above rule with: # RewriteRule \.(jpg|jpeg|png|gif|bmp) http://yourdomain.com/blocked.png [R,L]

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.