Welcome to Apache Prevent Hotlinking Linux PMC Tactical.
PMC websites shut down September 13th 2025 unless yearly web hosting fees are paid. Please Support PMC to help keep these websites online.
Website hosting and domain registration fees are due, please Support PMC, thank you. You can read more details from PMC websites from shared hosting to Virtual Private Server forum topic.
Apache Prevent / Block Image / File Hotlinking
Create a .htaccess file under the document root of your website. Then add the following rules to the created .htaccess file. This will block all domains except example.com to hotlink images from your site.
RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^https?://(.+\.)?example.com [NC] RewriteRule \.(jpg|png)$ - [NC,F,L]
You can also show a blocked banner in place of the hot-linked image. To show the banner use below rules in your .htaccess file.
RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^https?://(.+\.)?example.com [NC] RewriteRule \.(jpg|png) http://example.com/blocked.png [R,L]
Enjoyed or found this pages content useful, please Support PMC to help me keep this web page online beyond september 13th 2025 when yearly web hosting fees are due.