To
password protect the wp-admin page only and to avoid authentication
pop-up window on the other website pages
Follow
the following steps :
- First password protect the directory using the "Password Protect Directories" in the cPanel.
- After that add the following code in the htaccess of the domain.
<IfModule
mod_rewrite.c>
RewriteEngine
On
RewriteCond
%{QUERY_STRING} !=""
RewriteCond
%{QUERY_STRING} !^p=.*
RewriteCond
%{QUERY_STRING} !^s=.*
RewriteCond
%{REQUEST_URI} !^/wp-admin.*
RewriteRule
^(.*)$ /$1? [R=301,L]
</IfModule>
- It will show the authnetication request only for the wp-admin page