Is there a way to prevent apache from connecting to a specific domain e.g. somesite.com? I have a PHP script that trying to connect to specific host, and I would like to prevent that.
|
Correction: I found this tutorial on IPTables. Perhaps that can get you started. |
|||||||||
|
If the PHP script is accepting parameters in the URL such as Or use an iptables rule such as Having the php script modified would only be a few bucks on most freelance sites since it's pretty basic to add an if conditional statement that says if the URL entered is |
||||
|
I know this is somewhat hackish but it is dead simple to implement. If the script is attempting to connect to a dns based url (not an ip address based url), you could simply set your host file to point to 127.0.0.1 for that dns name only. This assumes you have no intention on browsing that particular site.
As a bonus, you can setup a virtual host locally to catch these requests and handle them however you want. Good-luck! |
|||
|