Saving General Settings when WPRocket is active

#361366
  • Resolved Ralf Kerkhoff
    Rank Math free

    Hi,
    i have a strange issue which occurs only in the General settings section of Rank Math.

    If I make changes there and hit “save” I end up with a server error “501 – not implemented”.

    Disabling WPRocket for the time I make changes in Rank Math general settings section will solve the problem and saving the changes will work fine.

    Seems to be a problem with the caching of WPRocket itself – because the error also occurs when all other optimizations in WP Rocket are disabled.
    I have also tested and reproduced it on a test installation with only Rank Math and WP Rocket installed, so I can exclude other plugins causing problems.

    Cheers
    Ralf

Viewing 7 replies - 1 through 7 (of 7 total)
  • Anas
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience caused.

    Could you please get in touch with your web host and ensure that the ModSecurity is disabled or they are not blocking any process of the plugin?

    Disabling ModSecurity should fix the issue.

    Let us know if the issue persists.

    We are here to assist you.

    Ok,
    thanks a lot. I will contact my Webhoster.
    What makes me wonder ist, that with WPRocket disabled anything works fine.
    Therefore I have a little doubt that it is reallly a mod_security problem.

    Ralf

    Hi,

    I sorted the issue out to one line of the htaccess entries generated from WP Rocket:
    This line will cause the 501 error:
    RewriteCond %{REQUEST_URI} !^(/(?:.+/)?feed(?:/(?:.+/?)?)?$|/(?:.+/)?embed/|/(index\.php/)?wp\-json(/.*|$))$ [NC]

    All other plugins are working fine – the error occurs only in Rank Math and only in the general settings section.
    The settings in the Titles and Meta section can be saved without the problem – only the general settings make that problem.

    Ralf

    Hello,

    Can you please confirm after sorting the .htaccess rule resolves the issue between Rank Math and WPRocket?

    We haven’t encountered any issues with regards to WPRocket and our plugin recently so the issue must be specific to your setup.

    Looking forward to helping you on this one.

    Hi,
    yes I have double checked this.
    It is the line I mentioned above that causes the error.

    The error also occurs on a fresh WordPress install with the default 22 theme and only RankMath and WpRocket active.
    therefore I can exclude that other Plugins are causing the problem.

    Cheers
    Ralf

    Hi,
    i have done some more research. Problematic is the section of editing the htaccess file in general options.

    The code for this option (or at least a part of it) is in the:
    class-option-center.php file
    between lines 80 and 94.
    commenting out this block will remove the possibility to edit the htaccess file directly from within the general option.
    The benefit:
    It will work with the rewrite rules WP Rocket done in the .htaccess file.

    Maybe that helps you with future versions of this excellent plugin.

    Ralf

    Hello,

    Thank you for providing more feedback on the situation including the exact code snippet that is causing this issue.

    We’ll do more testing on our local installations and if we discover a way to improve our codebase to “bypass” this rule we’ll implement the necessary fixes.

    Don’t hesitate to get in touch if you have any other questions.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘Saving General Settings when WPRocket is active’ is closed to new replies.