Welcome to Geeklog, Anonymous Wednesday, November 27 2024 @ 08:07 am EST

Geeklog Forums

where to put this code for visitor IP restoration?


Status: offline

Habitual

Forum User
Chatty
Registered: 01/28/10
Posts: 54
Location:Yawnstown, Oh. USA
Hello: I am using gl 1.8.1 atm on my site and I have cloudflare services as my front-end. It's on shared hosting at gdaddy, so I can't install any mod_s cf uses a reverse proxy on a Content Delivery Network very nicely. The downside is that GUS shows only cf IPs, I want original IPs shown and cf suggests here to "put this code in your site in or before the
Text Formatted Code
<body>
to restore my originating visitor IPs to the site.."
Text Formatted Code
`<?php if (isset($_SERVER['HTTP_CF_CONNECTING_IP']))
       $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
?>`
I'm pretty sure that the backticks are escapes for the published code... but could use a second opinion on that. I use the Professional theme with some minor modifications. Where should I insert this snippet? Thank you for your time.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Geeklog executes PHP in the header template, so you can simply insert the code in layout/professional/header.thtml as instructed (but without the backticks).

bye, Dirk
 Quote

Status: offline

Habitual

Forum User
Chatty
Registered: 01/28/10
Posts: 54
Location:Yawnstown, Oh. USA
Thanks Dirk!
 Quote

All times are EST. The time is now 08:07 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content