From ea9330ec8a45ffc8ae2b9874795d44f574cb69d6 Mon Sep 17 00:00:00 2001 From: Denis Verbin Date: Sun, 15 Feb 2015 21:17:12 +0200 Subject: [PATCH] Disable Image Hotlinking with Block Banner --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index c8bef7e..ad82293 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ What I'm doing here is mostly collecting useful snippets from all over the inter - [Deny Access to Backup and Source Files](#deny-access-to-backup-and-source-files) - [Disable Directory Browsing](#disable-directory-browsing) - [Disable Image Hotlinking](#disable-image-hotlinking) + - [Disable Image Hotlinking for Fixed Domains with Block Banner](#disable-image-hotlinking-for-fixed-domains-with-block-banner) - [Disable Image Hotlinking for Fixed Domains](#disable-image-hotlinking-for-fixed-domains) - [Password Protect a Directory](#password-protect-a-directory) - [Password Protect a File or Several Files](#password-protect-a-file-or-several-files) @@ -231,6 +232,14 @@ RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?badsite.com.*$ RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L] ``` +### Disable Image Hotlinking for Fixed Domains with Block Banner +This settings - rewrite all hotlinked images for fixed domains to your 'blocking banner' (ex. Image with you site url or message about hotlinking image) +``` apacheconf +RewriteEngine on +RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?badsite.com.*$ +RewriteRule \.(jpg|jpeg|png|gif) http://mysite.com/block_img.png [R,L] +``` + ### Password Protect a Directory First you need to create a `.htpasswd` file somewhere in the system: ``` bash