.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

php - Autoloader issue not returning Class -

python - Getting next two indexes regardless of current index -

ruby - Prevent Custom Validation Error on Association -