[Resolved] validate refferer for api protection

Status
Not open for further replies.

gdewey

Well-Known Member
#1
is there a way at LSWS layer, to validate an API consumption within the site and prevent a direct api atack?

that is

if referrer is not my site don't consume the api json feed

can this be done with Hotlink Protection ?

thanks
 

NiteWave

Administrator
#2
yes. this is hotlink protection for.
or simply use rewrite rule:

Code:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} !mydomain.com
RewriteRule .*.json$ - [F,L]
 
Last edited by a moderator:

gdewey

Well-Known Member
#3
yes just tested .. I was in the idea this was just for images. but works wonderful :)
by the way in the docs the "suffix" part is confusing.. there is no examples.

I added php as our json is provided by it.. it works but it was just a guess

tks for your support.
 
Status
Not open for further replies.
Top