2014-01-24 69 views
0

我試圖密碼保護index.php(或html)文件,但只能管理。子文件夾需要無密碼被訪問......只有index.php htaccess(沒有子文件夾,文件等)

喜歡的東西...

<Files "/var/www/clientarea/index.php"> 

AuthUserFile /var/www/clientarea/.htpasswd 
AuthName "Salasanasuojattu sivusto" 
AuthType Basic 
require valid-user 

</Files> 

回答

0

試試這個代碼:

SetEnvIfNoCase Request_URI "^/index\.(php|html?)" SECURED 

AuthUserFile /var/www/clientarea/.htpasswd 
AuthName "Salasanasuojattu sivusto" 
AuthType Basic 
require valid-user 
Satisfy any 
Order  allow,deny 
Allow from all 
Deny from env=SECURED 
相關問題