I have .htpasswd protection on my site that works fine. When I call a script that puts everything into cache via PHP CLI I get a 401 error. The problem here is the .htpasswd protection.
In the CLI call I define my env (ENV=cron), how can I tell my .htaccess to not ask for the username and password if env=cron?
My current code in the .htaccess is:
<IfDefine env!=cron>
AuthType Basic
AuthName "internal"
AuthUserFile /path/to/my/.htpasswd
Require valid-user
</IfDefine>
I am using apache 2.2 and not 2.4 which would make this a whole lot easier. What is the correct way of solving this issue?