For security reasons, we recommend that you avoid unauthorized access to your .htaccess file.
To do this, you need to understand how to find this file.
You can edit the .htaccess file using an FTP client or through cPanel.
Adding the security code to the .htaccess file
STEP 1:
Log into your cPanel account and open the File Manager in the Files section.
You must have made the correct settings to show the hidden files.
Because the .htaccess file is a hidden file with a period prefix; it means that you can see it if you have not activated it to be visible.
STEP 2:
You should search the public_html directory for ".htaccess."
Right click to edit the file and click edit.
STEP 3
Add this code:
# .htaccess protection
order allow,deny
deny from all
satisfy all
Click the "Save Changes" button displayed in the upper right corner.
This code will restrict unauthorized access to your .htaccess file.