Change WordPress Security KeyAugust 31, 2017
Petya-like infection attempts still active in AustraliaSeptember 1, 2017
It’s important to understand how password protection on a folder works. When you choose to password protect a directory in cPanel, cPanel creates a rule in your .htaccess file. This rule specifies that the folder is protected and the visitor will need to provide the proper username and password to log in and view the files.
Steps to Password Protect a Directory
- Log into cPanel
- Go to the Files section and click on the Directory Privacy icon
- Select the wp-admin folder then you will see the Set Permissions screen appear. Here you can provide a name for the folder you’re trying to protect.
- Next, click on the checkbox labeled Password protect the directory. Makes sure you have a name for the folder you are going to protect.
- Click on Save in order to save the name you have entered for the directory and option to password protect the directory.
- Create a user to access the protected directory
- Click Save in order to save the user that you have edited.
After Protect the wp-admin Folder
After activate the password for the wp-admin folder we need to add this code to the .htacess inside the wp-admin folder (not the .htacess in the root)
ErrorDocument 401 "Denied"
ErrorDocument 403 "Denied"
# Exclude the files ajax, upload and WP CRON scripts from authentication
Allow from all