The anomalous behavior of php?

There is a website, for example:

when you try to use the function get_headers or file_get_contents, it turns out this anomaly:

$url = "https://domain.com/catalog/sales/";

var_dump(
get_headers($path)
);


The query I'm doing an entirely different resource, but get no response from the remote server, and from my! Ie if on my server (the website from which you make a request) there is a section /catalog/sales/ - the answer is 200 OK. Same with file_get_contents($url); make a request to a remote resource, get the contents of his website!

Roughly speaking, the feeling that the domain to which the query is replaced by my domain!

This problem is only with some websites with https, perhaps associated with the certificate? probably some setting in php.ini ..

Plz tell me what could be the problem?
April 7th 20 at 15:44
2 answers
April 7th 20 at 15:46
Can be on the remote side is a filter on the UserAgent and if the queries can be redirected back to the sender. To understand this we need to set a custom UserAgent using curl for example
April 7th 20 at 15:48
$url = "https://domain.com/catalog/sales/";

var_dump(
get_headers($path)
);

Why do you define the url and the function get_headers pass a path argument? Apparently the problem is that we need the url argument to pass.

Find more questions by tags PHP