M3Server Technical Blog FAQ Prevent Hotlinking Static Content On Your Site

Prevent Hotlinking Static Content On Your Site



Add this to your .htacces file.


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https://(www\.)example.com/.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|png|css|pdf)$ - [F]