Secure a single controller with .htpasswd in cakephp
Sometimes you just want to secure several controllers, maybe temporary maybe for any other reason.
If you just have a basic cake application without any user management, .htaccess will help you.
1. oepn the app/.htaccess file of your Project.
2. Insert at bottom.
#specify witch controler needs a password auth
SetEnvIf Request_URI "^/app/webroot/controllerA" passreq
SetEnvIf Request_URI "^/app/webroot/controllerB" passreq
AuthName "Please Log in"
Allow from all
#Deny all calls where env=passreq, as you specified at top
Deny from env=passreq