RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC] RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]