如何将需要使用的.htaccess的所有文件,密码除了一个? [英] How would I require a password for all files except one using .htaccess?
问题描述
我有一个新的网站我工作的客户端要保守秘密,但在同一时间,我想在建页,把一个与它的一些信息。我想拥有一切,除了index.html的需要用户名/密码 - index.html的将是提供给大家。
我有以下的,但我不知道我需要添加:
AuthName指令限制区
与AuthType基本
的AuthUserFile /path/to/file/.htpasswd
目录AuthGroupFile的/ dev / null的
需要有效的用户
有太多的文件,并可能新文件说:这组文件需要用户名/密码。
我认为这是与类似于:
<文件的index.html>
为了否认,允许
允许所有
< /文件>
但我不完全知道如何。
AuthName指令限制区
与AuthType基本
的AuthUserFile /path/to/file/.htpasswd
目录AuthGroupFile的/ dev / null的
<文件*>
需要有效的用户
< /文件>
<文件的index.html>
所有允许
满足任何
< /文件>
I have a new website I'm working on that the client wants to keep a secret, but at the same time, I want to put an under construction page with some info on it. I would like to have everything except index.html require a user/password--index.html would be available to everyone.
I have the following, but I'm not sure what I need to add:
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /path/to/file/.htpasswd
AuthGroupFile /dev/null
require valid-user
There are too many files and possibly new files to say "for this set of files require a user/password".
I think it has something to do with something similar to:
<Files index.html>
order deny,allow
allow from all
</Files>
But I'm not exactly sure how.
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /path/to/file/.htpasswd
AuthGroupFile /dev/null
<Files "*">
Require valid-user
</Files>
<Files "index.html">
Allow from all
Satisfy any
</Files>
这篇关于如何将需要使用的.htaccess的所有文件,密码除了一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!