Removing Piwik from public view

It seems that if the Piwik dir is password protected in any way - even using mod_auth_imap - Piwik cannot track visits.

Is there any way to prevent Piwik from being seen by the public without interfering with Piwik? I don’t even want the public to be able to view the login page. Mod_auth_imap takes care of this, but prevents Piwik from working.

See 301 Moved Permanently