我想使用.htaccess密碼保護特定的網址。不同的網址指向相同的文件,但有不同的工作。我現在需要密碼保護只有一個網址。我試圖使用setenvif來做到這一點,但它似乎並沒有工作。我可能不完全瞭解apache setenv模塊的用途或用途。如何做條件.htaccess密碼保護
這是我的代碼似乎是什麼不工作
SetEnvIfNoCase Host "topasswordprotect\.domain\.com$" protecturl
<IfDefine protecturl>
Require valid-user
AuthName "Please enter your name and password"
AuthType Basic
AuthUserFile .htpasswd
</IfDefine>
相關問題:[有條件地要求HTTP認證取決於apache env變量](http://stackoverflow.com/q/5845353/195835)* – 2016-09-23 04:08:38