Can I install Apache Basic Authentication to lock a directory except for a single file?

I am working on an upcoming project, but the team needs to access it online. I have installed (for now) basic authentication using:

<Directory /var/www/html> AuthType Basic AuthName "Staging" AuthUserFile /etc/passwd Require valid-user </Directory> 

But I need one file to be publicly available (a third-party service must ping, but cannot handle basic authentication. Is it possible to "disable" authentication for a specific file ("specific-file". PHP ")?

I was learning:

  <Files "/var/www/html/specific-file.php"> ### SOMETHING </Files> 

but it’s not clear to me how to disable protection.

Thanks!

+6
authentication apache2
source share
2 answers

This works for me:

 Allow from all Satisfy any 
+2
source share

What happens when you use the following?

 <Files "/var/www/html/specific-file.php"> Order Deny, Allow Allow from all AuthType none Satisfy Any </Files> 

or try a combination of the above.

-one
source share

All Articles