I'm trying to limit the access to every file from a specific user through htaccess.
Is it even possible?
I can't figure out how to allow every file access only if username is not a specific one, I use an HTTP login with PHP (REMOTE_USER of $_SERVER)
You'll need to create a user database/specific user you want to allow with the htpasswd utility. From there, in your htaccess file in the directory you want to limit, use:
AuthUserFile /path/to/.htpasswd
AuthName "Authorization Form Title"
AuthType Basic
#Allow any valid user
require valid-user
#Allow only one user with specified username
require user username
More information can be found at plenty of online references, this is one of the first that came up: http://www.apacheweek.com/features/userauth
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With