X
X
xmoonlight2015-07-02 21:13:14
PHP
xmoonlight, 2015-07-02 21:13:14

How to specify domain for hot-link block dynamically?

Hello.
There is:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain2.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://hpmouse.googlepages.com/hotlink.gif [NC,R,L]

Necessary:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?[](.com|.ru) [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?[](.com|.ru) [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ http://hpmouse.googlepages.com/hotlink.gif [NC,R,L]

How to get [] so that the rule depends on the domain where this .htaccess is currently located?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2015-07-06
@xmoonlight

Answer here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question