Wolf-Tech
Wolf-Tech

Reputation: 1309

htaccess protection asks for every static file

i have a htacces protection for my current project:

<filesMatch "\.(htm|html|php)$">
    AuthGroupFile /dev/null
    AuthName "secured"
    AuthType Basic
    AuthUserFile /var/www/html/web/.htpasswd
    require valid-user
</filesMatch>

The protcetion is working but my static files cames from aws cloudfront and some files are asking for the htaccess credentials too. What can i do to stop this?

Thank you very much.

Upvotes: 2

Views: 262

Answers (1)

Wolf-Tech
Wolf-Tech

Reputation: 1309

AuthType Basic
AuthName "Restricted Area"
AuthUserFile /var/www/html/web/.htpasswd
AuthGroupFile /dev/null 
Require valid-user
SetEnvIf Host cloudfront.net allow
SetEnvIf Request_URI "(status.php)$"  allow
SetEnvIf Request_URI "(appredirect.html)$"  allow
Order allow,deny
Allow from env=allow
Satisfy

This is the current setting but to allow the host cloudfront.net is not helping.

Upvotes: 1

Related Questions