.htaccess - Stop hotlinking from another IP -


i have lot of domains , these hosting on 1 ip.

i tried use below code in htaccess protect hotlinking, doesn't work.

rewriteengine on rewritecond %{http_referer} !^$ rewritecond %{http_referer} !^http://(www\.)?103.222.219.45/.*$ [nc] rewriterule \.(jpg|jpeg|png|gif|ico|pdf|zip|js|css)$ - [f] 

how can protect hotlinking form ips?

the referer header contains url of previous page. contain ip address if ip address used in url instead of host name.

you need explicitly specify each of acceptable host names.


Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -