Stop other sites from using your images as their own. This rule examines the HTTP_REFERER value for the image request and redirects, or rejects, those that don’t originate from the specified domain.
Refer also to: Virtual Host Config or .htaccess?
Redirect Hotlinking Requests To A Specific Image
To prevent other sites from leveraging your images without permission add the following to your .htaccess:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?example\.com/.*$ [NC]
RewriteRule \.(gif|jpg|png)$ https://www.example.com/no-hotlinking.png [R=302,L]
The rule above would cause all requests to image assets that do not originate from your site to return /images/no-hotlinking.png, an image you can create with harsh messaging to the degree which you desire.
Return 403 for Hotlinking Requests
Instead of rewriting hotlink requests to a single image, you may choose to return a 403 response code when images are hotlinked. To do so, add the following to your .htaccess:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?example\.com/.*$ [NC]
RewriteRule \.(gif|jpg|png)$ "-" [F]
This rule would cause all requests to image assets that do not originate from your site to return a 403 Forbidden response.