PHP Hotlink to Selected DOMAIN I have 3 servers. 2 Servers which serve php file and is open to any person because theres no security. lets call them 1.2.3.4 and 1.2.3.5 another server is by domain lets say itsmydomain.com I wanna allow 1.2.3.4 and 1.2.3.5 php file only be called by itsmydomain.com, other user , include blank referrer or something or direct access to the php file will get 403 forbidden. I tried using $_SERVER http host, referer , and get client ip address all fails. I only want allow itsmydomain.com able call the php file in 1.2.3.4 and 1.2.3.5 Paying: $30 USD for BEST secured working solution Mode: Paypal Don't pm me saying your portfolio or experience, mail me the code and steps to include it, once tested and works i will send u the money via paypal. DO INCLUDE YOUR PAYPAL in the p.m THANKS AND more payment will be given if the job is done neat and good. Regards, Baoky
//check.php $domain = 'itsmydomain.com'; $restricted=1; if (preg_match("@https?://$domain/.*@", $_SERVER['HTTP_REFERER'])) $restricted=0; PHP: Then you have to include check.php in each file you want to be only seen by a certain domain. //say file 1.php include('check.php'); if($restricted) header('HTTP/1.1 403 Forbidden'); /* code code code...... */ PHP: If you get any questions ask me.
Not 100% sure I'm reading your query correctly but if you are going server to server so the server for itsmydomain.com calls to the by IP servers then in .htaccess for the 2 by IP servers you can do: <Limit GET PUT POST> order deny,allow deny from all allow from 1.2.3.6 </Limit> Code (markup): Where 1.2.3.6 would be the IP of the server hosting itsmydomain.com However if you only want to allow people who have been to itsmydomain.com and have the referer set then in the .htaccess for the 2 by IP servers put: RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://itsmydomain\.com/ [NC] RewriteRule .* . [F] Code (markup): Once done test.
Basically i have this php script. It grab a file from 1 of the famous video site. The issue is this script will ban my premium account if someone call the file directly from the script without using my server php file, it will detect multiple ip usage. So i must restrict the file to be call from my server aka Server A Server B & C is my remote host that hosting e script The script is using curl to grab the file, i just want prevent user directly enter. I got a config xml file aka config.php, it will call the file via that file, then stream to user. only wanna allow config.php to run the script hosted in server B or C(the remote server) any form of direct access to the php file in server B or C return 403 forbidden. sorry if I express it in a confusing way.
The 1st version of .htaccess that I posted will stop anyone using either server B or C, only server A will be able to access the PHP. You just need to put the IP of server A where I put 1.2.3.6. That .htaccess needs to go on both B & C servers and once there will block all IPs from accessing them other than server A.