Sunday, 8 September 2013

Preventing hotlinking IF NOT from an IP range

Preventing hotlinking IF NOT from an IP range

I have the usual WHM/Cpanel setup. All my domains are on the same NS ip
address (the NS server is the same server).
There are questions such as these, but the answers only showcase allowing
images by "referer". This is useless for me, because I want to allow all
my domains based on my IP, not list down specifically allowed domain
names.
This would be something like 99.99.99.0/24. Any domain that is on that IP
should be allowed to hotlink. Anything else, should NOT.
How to write this code? Guess I'm not looking for REMOTE_ADDR, nor for
HTTP_REFERER. I'm looking to specify an IP range instead.
Thanks for any pointers!

No comments:

Post a Comment