Yes, I think so.
But you should not settle with such solution.
There must be something very specific in your env that causes this.
I’ve been saving iTSec plugin settings to .htaccess and wp-config.php dozens of times in different envs but have yet to encounter the message you are getting.
There is quite some PHP code executed in the background, including setting file permissions, so the best thing to do would be to find out at what PHP command exactly it is failing. Once we know that we can determin the actual root cause of the issue… and solve it properly.
Right now we are only guessing based on the message we get … and I don’t trust that message …
Before we continue you should make sure you have enabled WP Permalinks (this is a requirement for the iTSec plugin to function properly).
Also make sure the following setting is enabled in Global Settings:
Write to Files [x] Allow iThemes Security to write to wp-config.php and .htaccess.
Do let me know whether these 2 were already set properly or not.
Now the message you are getting is displayed because the write_rewrites() class function\method returns false. I’ve analyzed this function\method and there are 3 situations where it would return a result of false:
1. There are NO changes to write … and a subsequent attempt to cleanup the .htaccess file fails …
2. There are changes to write but the function was unable to get the current .htaccess file contents.
3. There are changes to write but the function was unable to write to .htaccess file.
Obviously the message returned isn’t telling us everything …
As situation 3 correlates with the content of the message displayed and you have already checked that out I think we should focus on situations 1 and 2.
But first we need confirmation which one of the 3 situations applies.
Rename the wp-content/plugins/better-wp-security/core/class-itsec-files.php to class-itsec-files.php.old
Download this slightly modified copy of the file.
As it is a FAKE .zip file rename it after download to class-itsec-files.php and copy\move it into the wp-content/plugins/better-wp-security/core folder.
I’ve added just a few extra lines of code (5) for debug purposes.
Now reproduce the issue and then email the resulting debug_write.log file which can be found in the wp-content/uploads/ithemes-security/logs folder.
You can send the email to [moderated]
dwinden