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:


So you might have something else overriding?
Marc.
-
This reply was modified 6 years, 6 months ago by
Marc Lacroix.
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?
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.