0

I have several PHP scripts that are hosted on an Apache server on Debian. They are invoked from pages on my website and JS that is loaded from my server, where they are executed using AJAX/JQuery.

I would like to limit access so that only my pages on my server, and JS loaded from my server, can access there scripts, plus one or two other specific server IPs.

What is the best way to achieve this?

Thanks.

david
  • 1
  • 1
    If you know the exact IP addresses then you can check the IP in the PHP and decide what to do based on that – ADyson Jan 24 '21 at 10:20
  • Is https://stackoverflow.com/questions/5140997/restrict-access-to-functionality-for-user-by-ip-address what you are after? – Nigel Ren Jan 24 '21 at 10:28
  • These would work if I know all the IPs, however, let's say I just wanted the scripts to be executable from my site or JS loaded from my site, how would I do that? – david Jan 24 '21 at 11:02
  • 1
    Put it behind a login... you cannot prevent the call of your script otherwise – Honk der Hase Jan 24 '21 at 11:40

0 Answers0