views:

243

answers:

3

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.

A: 

have you tried reversing the order to first allow, then deny? For further reading: apache htaccess directive are a good reference.

heeen
Is list just me or does that link not work?
Darryl Hein
+4  A: 
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>
empi
A: 

I used empi response almost exactly, but I realized that I'm loading a logo and reset-min.css on the under construction page, so I modified it like the following:

AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/examplecom/example.com/html/.htpasswd
AuthGroupFile /dev/null

<Files "*">
Require valid-user
</Files>

<FilesMatch "(index\.html|reset-min\.css|logo-temp\.gif)$">
Allow from all
Satisfy any
</FilesMatch>
Darryl Hein