Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My raw access log is now filled with CloudFlare IP addresses. Is there any way I can use a .htacess file or configure the server to log the user's actual IP address?

With PHP, CloudFlare creates these environment variables for our reference, but I can't find anything similar for raw access logs.

Unfortunately, as suggested in this Stack Overflow question, using mod_cloudflare.c for the following is not an option on a shared hosting server:

share|improve this question

We have solutions for restoring original visitor IP with CloudFlare in our knowledge base.

share|improve this answer
Bad answer with an inaccessible link – Novocaine Sep 4 '15 at 9:35
That link loads fine for me. In addition, the server logs can only be addressed by one of the solutions in the link. Try again. – damoncloudflare Sep 5 '15 at 3:37
Actually see the issue(there is a weird redirect on that URL). The solutions are outlined at: support.cloudflare.com/hc/en-us/sections/… – damoncloudflare Sep 5 '15 at 3:40
Yeah, link didn't work for me either, but I've edited the post with your updated one, thanks Damon. – Simon East Sep 10 '15 at 7:00
The OP already tried mod_cloudflare but can't use it on shared hosting. Unfortunately this doesn't actually answer the question of how to get these in that case. – Andrew Lott Sep 10 '15 at 8:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.