PHP Script Redirection Issue Due to InfinityFree Security System

Read again

In short, even if you think you are “simply accessing your website with cURL”, it won’t work. This is the intended behaviour.

Those requests can only work with Javascript AJAX in the same website, not somewhere outside of your website.