Adding add the X-Forwarded-For (XFF) header in .PHP
Budget: $10 – $30 USD
Hi,
I have a website rajbihani.com. I am using ezoic.com (CDN provider) to display ads on my website. My nameservers are pointed to ezoic.com but web hosting is with the hostgator.in. Ezoic.com's CDN I am using to display Google ads on my website as ezoic is a 3rd party Google ad provider for publishers. But the problem is my web hosting provider is not whitelisting ezoic's IP addresses on their server as I am using shared web hosting with Hostgator. Because of this many of my site pages are not even opening on my own computer though they open good everywhere else. I contacted ezoic and they said I need to whitelist their IP addresses on the server but since I am not using VPN web hosting I cannot do that. They are asking to implement X-Forwarded-For (XFF) header and the method they gave is as below. But I cannot do as below as I do not have any files in my ftp by names like > header.php, init.php or config.php and also my site is not a wordpress site. My site is a customer site developed by me using some php scripts for uploading and retrieving content on my website. I want to know if this is possible to implement this header using cpanel & file manager (in cpanel) without any need for VPS hosting. If this is possible then let me know and if you can do it then bid for it. The site pages should start opening fine on my computer after doing this.
https://support.ezoic.com/kb/article/using-the-xforwardedfor-xff-header
How to add the X-Forwarded-For (XFF) header in .PHP and .NET?
It's worth creating a back up of your site. You can use tools like PHPmyadmin to do this.
Next, you need to put the XFF code in a file that all of your pages access (e.g. header.php, init.php or config.php)
In your header.php, init.php, or config.php file, you should already see $_SERVER['REMOTE_ADDR'] which you can replace with $_SERVER['HTTP_X_FORWARDED_FOR']
I have a website rajbihani.com. I am using ezoic.com (CDN provider) to display ads on my website. My nameservers are pointed to ezoic.com but web hosting is with the hostgator.in. Ezoic.com's CDN I am using to display Google ads on my website as ezoic is a 3rd party Google ad provider for publishers. But the problem is my web hosting provider is not whitelisting ezoic's IP addresses on their server as I am using shared web hosting with Hostgator. Because of this many of my site pages are not even opening on my own computer though they open good everywhere else. I contacted ezoic and they said I need to whitelist their IP addresses on the server but since I am not using VPN web hosting I cannot do that. They are asking to implement X-Forwarded-For (XFF) header and the method they gave is as below. But I cannot do as below as I do not have any files in my ftp by names like > header.php, init.php or config.php and also my site is not a wordpress site. My site is a customer site developed by me using some php scripts for uploading and retrieving content on my website. I want to know if this is possible to implement this header using cpanel & file manager (in cpanel) without any need for VPS hosting. If this is possible then let me know and if you can do it then bid for it. The site pages should start opening fine on my computer after doing this.
https://support.ezoic.com/kb/article/using-the-xforwardedfor-xff-header
How to add the X-Forwarded-For (XFF) header in .PHP and .NET?
It's worth creating a back up of your site. You can use tools like PHPmyadmin to do this.
Next, you need to put the XFF code in a file that all of your pages access (e.g. header.php, init.php or config.php)
In your header.php, init.php, or config.php file, you should already see $_SERVER['REMOTE_ADDR'] which you can replace with $_SERVER['HTTP_X_FORWARDED_FOR']