If I try to curl this css file like this https://web.archive.org/web/20170322073013cs_/http://afterschoolprograms.com/sites/all/themes/afterschoolprograms_dev/style.css?n , it return 403 Forbidden error. If I try to open it in browser it return the same error
If I open this page https://web.archive.org/web/20170322073013/http://afterschoolprograms.com/, this css page works fine and return 302 that lead to working css file.
Then If open the same css file again with browser, it works fine.
How can I always curl this css file and return the 302 redirection that lead to a working css file?
Here is the php code I m currently using and that always return 403 Forbidden error:
$url = "https://web.archive.org/web/20170322073013cs_/http://afterschoolprograms.com/sites/all/themes/afterschoolprograms_dev/style.css?n";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout in seconds
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // follow 301 redirection
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_USERAGENT,'waybackmachinedownloader');
$html = curl_exec($ch);
curl_close($ch);