How to use a RELATIVE path with AuthUserFile in htaccess?

后端 未结 9 1377
我在风中等你
我在风中等你 2021-01-31 12:51

I have a .htaccess that uses basic authentication. It seems the path to the .htpasswd file isn\'t relative to the htaccess file, but instead to the server config.

So eve

9条回答
  •  清歌不尽
    2021-01-31 13:44

    you may put your Auth settings into a Environment. Like:

    SetEnvIf HTTP_HOST testsite.local APPLICATION_ENV=development
    
      Allow from all
      AuthType Basic
      AuthName "My Testseite - Login" 
      AuthUserFile /Users/tho/htdocs/wgh_staging/.htpasswd
      Require user username
    
    

    The Auth is working, but I couldn't get my environment really running.

提交回复
热议问题