• Resolved stevovo384

    (@stevovo384)


    Good day

    A few days after installing the plugin, I got 502 Bad Gateway when trying to access the site. I was able to get access again by removing the below lines from the .htaccess file

    # Wordfence WAF
    <Files “.user.ini”>
    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
    </IfModule>
    </Files>

    # END Wordfence WAF

    After logging into the site and checking everything was fine, I then pasted the above back into the .htaccess file and the site is still ok now

    What could have been the reason? Will it happen again?

    FYI I had live traffic logging set to “All traffic”, but I changed it now to security only. I don’t know if that could be the cause

    Below I’ve pasted the full content of the .htaccess file:

    # BEGIN WordPress
    # The directives (lines) between “BEGIN WordPress” and “END WordPress” are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.

    RewriteEngine On
    RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ – [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    # END WordPress

    # php — BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php74” package as the default “PHP” programming language.
    <IfModule mime_module>
    AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
    </IfModule>
    # php — END cPanel-generated handler, do not edit

    # Wordfence WAF
    <Files “.user.ini”>
    <IfModule mod_authz_core.c>
    Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    Order deny,allow
    Deny from all
    </IfModule>
    </Files>

    # END Wordfence WAF

    • This topic was modified 3 years, 4 months ago by stevovo384.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support WFAdam

    (@wfadam)

    Hello @stevovo384 and thanks for reaching out to us!

    Do you happen to use Cloudflare? I have seen the new “Bot Fight Mode” cause this issue with the optimization.

    Can you send a diagnostic report to wftest @ wordfence . com? You can find the link to do so at the top of the Wordfence Tools > Diagnostics page. Then click on “Send Report by Email”. Please add your forum username where indicated and respond here after you have sent it.

    Ill take a look at your setup.

    Thanks again!

    Thread Starter stevovo384

    (@stevovo384)

    Hi

    Thank you for getting back to me

    I’m using a shared hosting provider (not Cloudfare), but I’ve noticed that even my cpanel site shows 502 bad gateway the same time when I get the 502 error on my site so I believe it’s some issue on the hosting side which I’ll take up with them

    Thank you

    • This reply was modified 3 years, 4 months ago by stevovo384.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘502 bad gateway’ is closed to new replies.