Create password protected directory using htaccess on server

Add security using password protected directory  on server as like admin site first ask to permission to go admin area. Add authentication on WordPress administration. Password protect our wordPress admin (wp-admin) directory. Bellow example for WordPress wp-admin password protected.

Step : 1

Login to your cpanel and go to “Password Protect Directories”.  After select directory OR add directory as your cpanel options. in my cpanel select directory in bellow screen short.

password-protected-1

Step : 2

Add protected directory name, username, password.

password-protected-2

Step : 3

Go to file manager and your selected directory create .htaccess file  with this script.


ErrorDocument 401 "Denied"
ErrorDocument 403 "Denied"

<Files admin-ajax.php>
Order allow,deny
Allow from all
Satisfy any
</Files>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s