This is not the usual request.
I need to protect a domain while keeping the inner files accessible.
So my HTACCESS file at the domain's root FTP folder is as follows:
AuthType basic
AuthName "Secure"
AuthUserFile /path/to/my/password/.ok_pass
<Files index.html>
Require valid-user
</Files>
This password protects my site if I visit it like this: www.mydomain.com/index.html
but not when I visit it directly like www.mydomain.com
.
So how do I set a password to the default document in a directory?
So, you want it to require a password for / and /index.html but not anything else?
Add:
It's an unusual request, but I think you'd have to password-protect the entire root directory and then override that for all the contents. Overriding it lower down to allow everyone could be tricky and it's something I've never done before, but this might work: