JR Galia
JR Galia

Reputation: 17269

PHP file_get_contents for the same domain

I have the line below:

file_get_contents('http://mydomain.com/page1');

When using CloudFare, a 403 Forbidden happened. How to get the content of a page in the same domain? Alternative for file_get_contents w/o being forbidden by CloudFare?

Upvotes: 0

Views: 772

Answers (1)

Phil
Phil

Reputation: 164764

It's probably some internal routing issue. Looks like you'll need to use the hostname CloudFlare sets up that bypasses CloudFlare and goes directly to server. From what I'm reading, it might be something like direct.mydomain.com.

See the following

Upvotes: 1

Related Questions