如何将需要使用的.htaccess的所有文件,密码除了一个?如何将、密码、文件、htaccess

由网友(╰╮若有你╮同甘共苦)分享简介:我有一个新的网站我工作的客户端要保守秘密,但在同一时间,我想在建页,把一个与它的一些信息。我想拥有一切,除了index.html的需要用户名/密码 - index.html的将是提供给大家。我有以下的,但我不知道我需要添加:AuthName指令限制区与AuthType基本的AuthUserFile /path/t...

我有一个新的网站我工作的客户端要保守秘密,但在同一时间,我想在建页,把一个与它的一些信息。我想拥有一切,除了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>
所有允许
满足任何
< /文件>
 
我根据百度上的方法用re查看文件来查WiFi密码,点开来之后根据百度上说的密码位置我看了怎么是一大

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>

阅读全文

相关推荐

最新文章