1
我想爲除了來自特定IP範圍的請求和具有URL路徑的URL之外的所有內容獲得基本身份驗證。 (在我的情況下,這些總是以.html結尾)僅針對帶有URL路徑請求的Apache基本身份驗證
IP範圍工作正常,但我無法得到請求去拋出.html的結尾。例如:
http://subdomain.domain.com/test.html或http://subdomain.domain.com/test/test.html
應允許無需驗證,而
應該被拒絕。
這是我的.htaccess中的基本認證塊:
SetEnvIf Request_URI ".html$" auth=1
Order deny,allow
Deny from all
AuthType Basic
AuthUserFile /path/to/.htpasswd
AuthName "Login"
require valid-user
Allow from 123.456.78 env=auth
Satisfy Any
謝謝您的回答,但它仍然要求我要對URL進行身份驗證結尾.html – Sebastian
已經嘗試過,同樣的事 – Sebastian
你有一些其他的配置問題,因爲我已經在我的Apache上測試過相同的代碼,並且沒有'Allow from 123.456.78'行,並且它在兩種方式下都可以正常工作。 – anubhava