It is a very good idea to set read-only access to certain folders and files. Although you can’t do this in your .htaccess, you can do it at the server panel or OS level.
It’s important that you set permissions on your configuration files and files that include connection settings as read-only.
For Unix/Linux systems set the .htaccess permission file to 444.
If you cannot do this with your FTP software, try using the File Manager supplied with your webhosting account.
For Windows server systems, simply set the file as “Read-Only” for “Everyone” and especially the IUSR_xxxxx (Internet Guest Account) user if running IIS, or the “System” account or “apache user” if running Apache.