.htaccess 和文件夹保护 - 我应该在另一个文件夹中创建另一个 .htacess 文件吗?
.htaccess 文件包含重写规则列表并且工作正常,
.htaccess 文件位于根目录中,
.htaccess 包含:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} !POST
RewriteRule ^index.php / [L,R=301]
如何密码-保护/secret文件夹?
我应该添加
AuthUserFile /secret/path/to/safedirectory/.htpasswd
AuthGroupFile /dev/null
AuthName EnterPassword
AuthType Basic
require valid-user
到根目录中的 .htaccess 文件吗?就在上面的代码之后,还是在最开始?
或者,我必须在 /secret 文件夹中创建另一个 .htaccess 文件,并将 .htpasswd 放入 /secret/safedirectory< /em> 文件夹?
谢谢。
.htaccess file contains a list of rewrite rules and works fine,
.htaccess file is in the root directory,
.htaccess contains:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} !POST
RewriteRule ^index.php / [L,R=301]
How to password-protect a /secret folder?
Should I add
AuthUserFile /secret/path/to/safedirectory/.htpasswd
AuthGroupFile /dev/null
AuthName EnterPassword
AuthType Basic
require valid-user
to .htaccess file that is in the root directory? Right after the code above, or at the very beginning?
Or, I have to create another .htaccess file in the /secret folder, and put .htpasswd into /secret/safedirectory folder?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否将其放入秘密目录中的 .htaccess 中?
您必须将 .htaccess 放在秘密目录中
Did you put this in the .htaccess in the secret directory?
You have to put the .htaccess in the secret directory