I need to find a way to use PHP to enable access to .html files protected by .htaccess. The current setup relies on mod_auth_ldap, allowing users to see the .html files.
The setup I would like to create would have a php script that the user logs into and then allows them to access the .html files while preserving the current level of security and leveraging on the existing structure.
So in short: I need to pass along authentication from PHP to Apache2. Is this possible?
After much work, thanks to cainmi’s suggestion I have come up with a solution.
My .htaccess for the protected directory looks like this
This passes the requests back to my php script which checks for Auth and if it passes does the following
Responding with the file and the proper MIME type
Because some of the content I was serving had XML I had to disable short open tags. I achieved this by adding this line to the .htaccess of the directory that held the wrapper.
Stackoverflow was integral to finding this solution and for that I thank you all.