1. WordPress (Recommended Method)
For WordPress sites, you can modify your wp-config.php file to capture the real IP.
-
Access your site files via FTP or File Manager and open wp-config.php.
-
Add the following code snippet (usually near the top of the file, after the <?php tag):
// Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0];
}
2. General PHP Sites
If you are using a non-WordPress PHP site, you can replace the standard remote address variable.
-
Locate a global configuration file (e.g., header.php, init.php, or config.php).
-
Find any instance of $_SERVER['REMOTE_ADDR'] and replace or supplement it with: $_SERVER['HTTP_X_FORWARDED_FOR']
3. .NET Sites
For applications built on .NET, use the following string to capture the header: HttpContext.Current.Request.Headers["X-Forwarded-For"]
Inform Your Host
Implementing the code on your site is only half of the solution. You must contact your hosting provider's support team and inform them that you are using Ezoic.
What to tell your host:
"I am using Ezoic's proxy service. I have implemented the X-Forwarded-For header on my site. Please ensure your server-side security (ModSecurity, Firewalls, etc.) is configured to recognize the XFF header so that Ezoic's IP addresses are not rate-limited or blocked."