HTTP Basic Auth Exclude Single File

前端 未结 2 1303
一个人的身影
一个人的身影 2020-12-29 05:43

Part of my .htaccess file looks like this-

AuthUserFile /path/to/.htpasswd
AuthName \"Authorization Required\"
AuthType Basic
require valid-user
相关标签:
2条回答
  • 2020-12-29 06:14

    With Apache 2.4 you may want to use Require instead:

    <Files "thubservice.php">
        Require all granted
    </Files>
    

    In 2.2, access control based on client hostname, IP address, and other characteristics of client requests was done using the directives Order, Allow, Deny, and Satisfy.

    In 2.4, such access control is done in the same way as other authorization checks, using the new module mod_authz_host. The old access control idioms should be replaced by the new authentication mechanisms, although for compatibility with old configurations, the new module mod_access_compat is provided.

    0 讨论(0)
  • 2020-12-29 06:20
    AuthUserFile /path/to/.htpasswd
    AuthName "Authorization Required"
    AuthType Basic
    require valid-user
    <Files "thubservice.php">
        Satisfy Any
        Allow from all
    </Files>
    
    0 讨论(0)
提交回复
热议问题