I am working on a website, that will have a large number of files. So, I made a separate server for my files such as images and txt files. The problem is that php's file_get_contents function does not work for this server.
I have tried echo file_get_contents("http://url");
and I get nothing, but when I do echo file_get_contents("http://google.com");
I get google's homepage. This the same case for a curl connection.
$ch = curl_init();
$url = "http://running-files.rf.gd/hello.html";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_MAXREDIRS, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$body = curl_exec($ch);
$info = curl_getinfo($ch);
$error = curl_errno($ch);
curl_close($ch);
echo $body;
My guess is that there is something need in the .htaccess file. Anyone have some suggestions?