I have a file (called ‘log.html’) on my iis7.5 server that I would like my PHP installation to be able to access and write to, but I do not want anybody to access the file directly, for example typing in ‘http://computername/log.html‘ (I am on a LAN).
How can I prevent users from accessing it but allow php to see it?
When using the web.config file suggested below, I get this error:

I think that I may have answered my own question! I still need to test it a bit more, and perhaps if it does not work completely then someone could correct me:
The cache control bit prevents the browser from caching anything that it returned.
Hope this helps somebody else! I am still very new to this, so you might be able to get around this.