Using filesMatch for multiple file types with auto_append_file

I currently use the following in my .htaccess file to log visits to html files in a given directory.

               <FilesMatch "\.(html?)$">
               php_value auto_append_file "/usr/home/myspace/WWW/html/count.php"

I want it to log ALL files except .css files.

This includs (but is not limited to):

Can I have it log all files EXCEPT ones that end with .css?

If not, do I have to list all posible extentions out right?

LVL 16
Who is Participating?
CrYpTiC_MauleRConnect With a Mentor Commented:
Are the images coming up? I have never tried including a file into an image, seeing that it might corrupt the image file and make it not display.

Try this slight variation....

 <FilesMatch "\.([^c][^s][^s][a-z0-9]?)$">

Should allow any 3-4 character extension and not allow .css

Also do this...

<Files ~ "\.([^c][^s][^s][a-z0-9]?)$">
ForceType application/x-httpd-php

So it allows the PHP engine to parse any file except .css otherwise image files wont have PHP engine include the file.
Keep me posted on the progress, once this gets figured out will probably use it on my site too =oP. Good luck!
<FilesMatch "\.([^c][^s][^s][a-z0-9]+?)$">

you can try this...
hankknightAuthor Commented:
Thanks!  This is still not working for my .png, .gif and .jpg files.  

Any ideas why?
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

why not just use:

<FilesMatch \.(?i:gif|jpe?g|png|htm?l|php)$>
>  <FilesMatch "\.([^c][^s][^s][a-z0-9]?)$">
>  Should allow any 3-4 character extension and not allow .css

does not allow .asa for example

I'd go with a white list as suggested by yuzh
hankknightAuthor Commented:
CrYpTiC_MauleR Said:
               <Files ~ "\.([^c][^s][^s][a-z0-9]?)$">
               ForceType application/x-httpd-php

Thanks!  This is what I needed.  I thought that the trouble was with my regular expressions but the problem was  because the images weren't being touched by PHP, the php_value auto_append_file command did nothing.

Now I need to evaluate the security implications of processing most filetypes as php scripts...
All Courses

From novice to tech pro — start learning today.