Forum Moderators: phranque
Welcome to WebmasterWorld [webmasterworld.com]!
As stated in our Charter [webmasterworld.com], we try not to write people's code here, but this thread [webmasterworld.com] may give you a good place to start.
Jim
<Files "/index.php">
Allow from all
Require None
Satisfy Any
</Files>Order allow,deny
AuthName "Acces Restreint"
AuthType Basic
AuthUserFile "/.htpassword"
Require valid-user
If I use:
Order allow,deny
it returns:
You don't have permission to access /index.php on this server.
If I use:
Order deny,allow
it asks for login/password for all files (even /index.php)
:((
Try something like this:
AuthUserFile /.htpass[b]wd[/b]
AuthGroupFile /dev/null
AuthName "Acces Restreint"
AuthType Basic
Satisfy any
Require valid-user
#
SetEnvIf Request_URI ^/index\.php public
#
<Files *>
Order Deny,Allow
Allow from public
</Files>
or maybe this would work:
AuthUserFile /.htpass[b]wd[/b]
AuthGroupFile /dev/null
AuthName "Acces Restreint"
AuthType Basic
Require valid-user
#
<Files /index.php>
Satisfy any
Order Deny,Allow
Allow from all
</Files>
I'd bet on the first version one, though, because authorization is the first thing the server looks at in an .htaccess context, and it may be too late to modify authorization (with 'Satisfy') by the time it processes <Files>.
I haven't tested either of these, but derived them from the thread I cited above in post #2.
Also, note that I've used the standard password-file name, so that later viewers of this thread won't be confused. You should continue to use your customized name, though.
Jim