-3

NOTE: I know this way CloudFlare and logging visitor IP addresses via in PHP I want another solution, another operation to check download without user IP This Question not duplicate

I have a website that allows users to download Files. I have a function that uses the user's IP address to check if the user downloads from my website, or gets direct download bypassing my website.

My problem comes when I protect my website with Cloudflare. The problem is that Cloudflare changes the user's IP address and the check process returns fail all time.

I am working on a main server and sub-servers

Ex:
site.com
server1.site.com
server2.site.com

IP's differ between the main server and sub-server, Even with the use of cloud flare settings

Are there any ways to solve this problem ? Is there another operation to check download without user IP address? Thanks.

Community
  • 1
  • 1
ALMGHARI
  • 9
  • 2
  • 6
  • possible duplicate of [CloudFlare and logging visitor IP addresses via in PHP](http://stackoverflow.com/questions/14985518/cloudflare-and-logging-visitor-ip-addresses-via-in-php) –  Jan 07 '15 at 23:25
  • 1) You already asked this a few hours ago. 2) Why do you want to ignore the very facilities provided exactly for this purpose and reinvent the wheel? What's wrong with the solution on the linked question? –  Jan 07 '15 at 23:28

1 Answers1

3

Quote from their website:

To restore the original visitor IP addresses to log files and web applications running on Apache httpd web servers, you will need to install mod_cloudflare. To install mod_cloudflare, follow the installation steps described on our Downloads page.

If you follow their steps it should work. I didn't test it yet, but you made me curious so I will do someday :D

I hope this helps!

Robin Valk
  • 234
  • 2
  • 8