Regex to allow all php files except one
- by Tim
Hi all,
I have this regex that allow all php files :
^.*\.([Pp][Hh][Pp])
how can I exclude a specific file, for example test.php ?
Thanks for your answer,
Best regards
[edit]
I omit to say that it is a reg from a htaccess file, the /i doesn't seems to work, and the ? neither.
[Edit2]
the purpose is to grant access to authenticated users, except for one file that has to be allowed for everyone.
So I've done :
<Files ~ "^.*\.([Pp][Hh][Pp])$">
AuthUserFile /directory/.htpasswd
AuthGroupFile /dev/null
AuthName "Please log in ..."
AuthType Basic
require valid-user
</Files>
So, all php files require valid user.
I would like to add an exception for a specific file, says test.php