What is the name of the domain?
What is the error number?
302 not found cloudflare
What is the error message?
getting cloudflare login page
What is the issue you’re encountering
I have 2 sites on same domain. I am trying to get documents from one website with the help of code in php wordpress to upload to second website.
What steps have you taken to resolve the issue?
I have tried using a bypass policy:
I created a new application with the documents folder URL and added a policy to bypass for everyone, which worked, but it made the documents publicly accessible. This is not what I want—I need the documents to be secure, either through Cloudflare or via WordPress login.
I also tried using a policy with a service token and IP range, but in those cases, the code didn’t work. Please note that I am using the file_get_contents function to retrieve the documents in my code.
Additionally, I enabled the bypass for everyone and tried securing the documents by adding code to the .htaccess file. This secured the documents but caused file_get_contents to stop working.
Another solution I attempted was adding a bypass for everyone while also modifying the Nginx config file. This worked well—the documents were protected with a 403 forbidden response, and the code for retrieving the documents worked. However, the documents were not visible to logged-in users, and the requirement is that only logged-in users should be able to view them.
The main requirements are:
I want the documents to be accessible only to logged-in users.
I need the documents to be uploadable to the second website via PHP code.
Please help me resolve this by allowing file_get_contents to work with Cloudflare, without the need for a bypass policy.
What are the steps to reproduce the issue?
I can not share domain name.