是否有可能使用的.htaccess来保护整个网站,比的index.html登陆页面等?
Is it possible to use .htaccess to protect an entire site, other than the index.html landing page?
事物的密码保护一面是容易的。
The password protection side of things is easy.
一直在寻找年龄,我已经拿出最接近的是添加以下算账:
Have been searching for ages, and the closest I've come up with is add the following afterwards:
<Files index.html>
satisfy any
</Files>
虽然这个工作,如果有人访问 http://www.example.com/index.html,它的不的工作,如果他们访问 http://www.example.com ,即使我想补充的DirectoryIndex index.html的。删除的东西密码保护侧带他们到index.html的,但它也要求输入密码时,我只需输入域名。
While this works if someone visits http://www.example.com/index.html, it doesn't work if they visit http://www.example.com, even if I add DirectoryIndex index.html. Removing the password protection side of things takes them to index.html, but with it in it asks for a password when I just enter the domain name.
是否尝试过的东西喜欢用重写规则重写^ / $以index.html的或含有的登录页面的子目录 - 但这些不工作,因为它似乎验证任何重写之前完成
Have tried things like using rewrite rules to rewrite ^/$ to index.html or a subdirectory containing the landing page - but those don't work since it seems the authentication is done before any rewrites.
这甚至可能吗?
推荐答案
好像这里没有人知道答案,但我设法从别人的解决方案:
Seems nobody here knew the answer, but I managed to get a solution from someone else:
<Files .>
satisfy any
</Files>
相关推荐
最新文章