I want to be able to prevent hotlinking and show a specific image only for some domains.
I have tried this method but this prevent all sites from hotlinking using .htaccess
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?example.com/.*$ [NC,OR]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?example.com$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?example\.com/ [NC]
RewriteRule \.(gif|jpg|jpeg|png|webp)$ https://image.example/img/logo.jpg [R=301,L]
My question is:
Lets say for example my website is: example.com
and I want to prevent hotlinking only for this specific domain: domain-name.example
.
How can I modify the code above in order to prevent only that specific domain from hotlinking?