count the number of accesses to a particular file

Discussion in 'Apache' started by realin, Mar 16, 2008.

  1. #1
    hi all,

    i just want to know if it is possible that i count the number of accesses to a particular image file in a folder using .htaccess

    actually i want to know that how many times my newsletter was read..

    Thanks and Regards
     
    realin, Mar 16, 2008 IP
  2. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #2
    A CustomLog directive in the sites <VirtualHost> container combined with a <FilesMatch> container to limit logging to a specific file or set of files using a regular expression can be used.

    Or you can just find an entry for that image in your servers existing access logs.

    htaccess by itself doesn't have any means to log file access that I'm aware of though. It has to be done in the <VirtualHost> container.
     
    joebert, Mar 17, 2008 IP