• Resolved Hot Themes

    (@hotwptemplates)


    Hello,

    I want to report a bug in this plugin, version 3.0.13. If website contains a .htaccess file with some data (in example 301 redirections) and try to enable GZIP compression under Cache, if this message appears:

    We successfully added Gzip compression settings into .htaccess file. However, the test file we fetched was not Gzip-compressed. It seems one of Apache modules - mod_filter or mod_deflate - is not active.

    the user’s custom .htaccess would be overwritten.

    Luckily, I had a backup of my .htaccess file, but I think you should fix this.

    Thanks,
    Milos

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi Milos,

    When the relevant section does not exist in the .htaccess, WP-Optimize will add its settings at the end of the file, and not override them.

    If the section already exists and some parameters changed, it will replace the contents between the comments:

    # BEGIN WP-Optimize Browser Cache

    # END WP-Optimize Browser Cache

    I have tested again to make sure, and for me, only the changes between WP-Optimize tags are overridden when saving the relevant settings.

    Here are screenshots of my tests:

    Screen-Shot-2019-11-20-at-11-40-59

    Screen-Shot-2019-11-20-at-11-41-39

    So you might have something else overriding?

    Marc.

    • This reply was modified 6 years, 6 months ago by Marc Lacroix.
    Thread Starter Hot Themes

    (@hotwptemplates)

    But what if somebody is using this plugin for the first time and doesn’t have these comments in .htaccess file, and, at the same time has some custom code in .htaccess file, in example 301 redirects? Could you test this please?

    This is what the screenshots above show:

    It first contains the default WordPress settings, plus some custom 301 redirects, which I manually added.

    Then I enabled browser caching, and the section was added after the 301 redirects which I had previously manually edited.

    I tested this several times on different configurations.

    Could you maybe share the list of plugins that are enabled on your site, to see if any of them could be causing this?

    Thread Starter Hot Themes

    (@hotwptemplates)

    In your case, is the GZIP compression enabled successfully or you got the same message as I did? Maybe it doesn’t work correctly only if the GZIP compression enabled is not enabled successfully.

    Yes it was enabled successfully.

    But the fact of editing the .htaccess happens the same way, wether the compression works or not: it uses the same method to write in the file.

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

The topic ‘.htaccess file overwritten’ is closed to new replies.