I have a .exe
file located in a directory on my server running on Apache 2. Is there any way to check the number of downloads for a specific file and display it on my webpage (CMS written in PHP)? What do I need to do in order to achieve that? I tried to add a record to my MySQL database on every click of a link on my webpage (it's working), but I need a count all of the downloads, not only by my link (that means including a count of the direct downloads by writing for example http://example.com/file.exe
).
I think you should try an Apache rewrite rule , for instance, you could rewrite every request to any .exe file to be redirected to a php as a parameter. Then you can use the mechanism you designed (MySQL records in a database).