I am running this website, and i'd like to configure my .htaccess file so that whoever tried to hack into my website has only read-only (no write) access to particular folders or directories. How can I accomplish that?
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 OS level.
It's especially important that you set permissions on your configuration files and files that include connection settings as read-only.
For Unix/Linux systems use the default .htaccess as supplied and then set the directory permisisons to 755 and file permissions to 644, or in some cases 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.