CakePHP + admin routes + .htaccess + production mode

Hi all!

The following site shows a (kinda hack-ish) way to protect an admin route with .htaccess:

If I understand it correctly, it only works because CakePHP runs a check for the 'real' file presence before it processes its own URL logic. So, when you request, it checks for the default document in the (real, since we've created it) /admin dir, and this check triggers the authentication.

My issue is: the 'hack' works OK if I set my debug level to '1' or higher. If I set it to Production Mode ('0'), I just get a cake-interpreted HTTP 401 (Access Denied) error.

So, my question is: is there any way to make this 'hack' work with the debug level set to zero?