- This topic has 5 replies, 2 voices, and was last updated 5 years ago by
Elvin.
-
AuthorPosts
-
March 31, 2021 at 5:23 pm #1717258
Ken
Searched and the two answers were not helpful at all.
Original Problem:
I’m getting “Origin Error” when going to my wp-login, trying to work inside the dashboard, navigating the site, because I’m using Ezoic.
Ezoic suggested among other things (which I tried) to implement X-Forwarded-For (XFF) Header on WordPress.
“Simply copy and paste the code below to your “theme’s” wp-config.php file.
Present Problem: Ezoic says that we need to contact the “Theme Owners” to learn where to add the XFF code.
My Question: Can someone, preferably with a screenshot, show me exactly where to paste the code?
It’s no problem getting access to my site, I use Mac app Forklift.
Here’s the code I need to paste in Generatepress’s wp.config.php file:
// 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];
}
March 31, 2021 at 6:30 pm #1717291Elvin
StaffCustomer SupportHi there,
wp-config.php isn’t a theme file, it’s a core WordPress file on the site’s root folder. You will need to access this file using FTP or any file editor that your hosts server panel provides.
Example: https://share.getcloudapp.com/ApuYNBn7
If you don’t know how to do this then speak with your Hosting provider
March 31, 2021 at 7:02 pm #1717301Ken
Hi Elvin,
Just to confirm. I need to contact my hosting, so they can tell me where in my wp-config.php file I should add the code… correct?I know how to access my wp-config.php. I don’t know exactly where to paste the code.
Hmm, interesting that Ezoic is telling us that we need to contact the Theme Developer.
If this is in fact wrong, then I’ll sent a feedback to Ezoic saying that we should contact the Host, if that is indeed what we should do.
Please let me know if you meant that hosting can help with the placement of this code in the wp-config.php.
Thank you.
March 31, 2021 at 7:24 pm #1717309Elvin
StaffCustomer SupportJust to confirm. I need to contact my hosting, so they can tell me where in my wp-config.php file I should add the code… correct?
If you know how to do it through FTP or your hosting’s file manager tool (if they have one), then you don’t have to contact them and just do it yourself.
If you don’t know how to, then yes, you have to ask them for assistance.
The code you’ve provided can be placed on the bottom-most part of the file.
Hmm, interesting that Ezoic is telling us that we need to contact the Theme Developer.
If this is in fact wrong, then I’ll sent a feedback to Ezoic saying that we should contact the Host, if that is indeed what we should do.
It’s not theme specific: https://wordpress.org/support/article/editing-wp-config-php/
March 31, 2021 at 9:12 pm #1717356Ken
The code you’ve provided can be placed on the bottom-most part of the file.
Yes, that’s what I was looking for.
Thank you Elvin.March 31, 2021 at 9:52 pm #1717368Elvin
StaffCustomer SupportNo problem. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.