A
A
apptimeru2018-06-27 12:10:49
Apache HTTP Server
apptimeru, 2018-06-27 12:10:49

How to restrict access to site resources from certain ip?

Guys, please tell me how to prohibit loading images, styles, scripts (hotlinks) on other resources with a specific ip through the .htaccess file?
Found this code:

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

But as I understand it, it prohibits all sites except mine, but can it be banned by a specific domain, for example, or by ip?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question