Sometimes you don’t want themes or plugins to automatically modify and write to your .htaccess file. So using a code snippet to tell WordPress not to write to the .htaccess file as a quick fix.
Before You Continue !!
Editing any core WordPress files can be dangerous. Even a small mistake can cause major errors on your site.
Add The Code
Simply add the following code snippet at the end of your wp-config.php file.
add_filter('got_rewrite', '__return_false');
Then “Save” file. Now WordPress will no longer write to the .htaccess file.
Attention !!
If you try to change your permalink settings when .htaccess is set to read-only, then an error message will be displayed.
Permalink Settings
This lets you know that WordPress was unable to modify the .htaccess file automatically. Normally, this is what you intended. Also at the bottom of the Settings ≫ Permalinks page, you will see another error message saying that your .htaccess file is not writable. So you will need to edit the file manually, if required.