Modifying .htaccess & wp-config.php files would be necessary by various plugins like SSL, Security, Caching, SEO plugins, etc., in order to enable certain features automatically like “Force HTTPS” feature of WP Encryption WordPress SSL plugin.
Manually trying to add some code snippet into .htaccess or wp-config.php files could sometimes go wrong and even with a minor misplacement or error, your WordPress site would be down showing some weird error which would freak out non-technical users. So most of the time, its better to allow trusted plugins to automate the process on its own.
How to make htaccess writable?
If you are wondering what is this .htaccess file, htaccess rules instruct Apache server to handle certain redirections like HTTP to HTTPS and permalinks accordingly. Please follow the step by step instructions to make htaccess writable:
- Login to your cPanel / hosting panel.
- Find & click on the File Manager tool (Some hosts may have it in different places like tools > File Manager).
3. Navigate to File Manager Settings and make sure to enable “show hidden files” option.
4. In the below screenshot, you can notice file permission of .htaccess file is 444. Setting this to 644 would allow plugins to make changes to this file. You can also revert back this file permission after the change if required.
5. Right click on the .htaccess file and click on Change Permissions option
6. Make the file writable for owner and thus setting the permission to 644.
That’s it!.. Your .htaccess file should now be writable. Reloading the plugin page on your wp-admin would detect these changes. Anyhow, on fully restricted servers & custom managed servers like AWS, Digital Ocean, etc., Changing permissions via FTP or File Manager may be restricted and you might have to login via SSH console and change the file permissions.
In order to make wp-config.php file writable, please follow the same instructions > right click on wp-config.php file and change permissions to 644. Now you have learnt how to handle file permissions like a security ninja! 😉