E
E
elesei2015-01-29 17:58:50
PHP
elesei, 2015-01-29 17:58:50

How do I prevent images from being used on another site?

Hello, please tell me how can I disable the use of site images by predefined sites?
There are sites that not only take content, but also take pictures directly from the site (which creates a load accordingly).
I would like to be able to substitute a specific picture instead of images (not all, but only certain ones).
There is a rule:
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^ http://(.+\.)?yoursite\.ru/ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif |bmp|png)$ /images/empty.jpg [L]
But it substitutes an image for all sites, and is necessary only for certain ones.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SagePtr, 2015-01-29
@SagePtr

Something like this:

RewriteEngine On
RewriteCond %{HTTP_REFERER} ^https?://(.+\.)?badsite1\.ru/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^https?://(.+\.)?badsite2\.ru/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^https?://(.+\.)?badsite3\.ru/ [NC]
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/empty.jpg [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question