Use HTTP Auth only if accessing a specific domain

前端 未结 5 1403
青春惊慌失措
青春惊慌失措 2020-12-30 06:02

I\'ve got several sites: example.com, example1.com, and example2.com. All of them point to my server\'s /public_html fo

5条回答
  •  醉梦人生
    2020-12-30 06:55

    Apache 2.4 offers a semantic alternative with the If directive:

    
        AuthUserFile /path/to/htpasswd
        AuthType Basic
        AuthName "Password Protected"
        Require valid-user
    
    
        Require all granted
    
    

提交回复
热议问题