Forum Moderators: phranque
At the moment I am using Apache's server-side include mechanism to get the output of the script to appear on my page.
But I don't want a user or another site to be able to call the PHP file.
I've had no luck so far in allowing Apache and PHP access to the file while making it invisible to the outside world. Any attempt to block access to the outside world has caused Apache to output a warning onto my pages instead of the output of the script. So far I've tried using "deny from all" and I've also tried removing public access permissions from the file.
Surely there's a way of letting Apache and PHP make use of this file without it being world-readable?
this would allow the file to still be included but would not allow someone to call it directly in a browser.
The thing I don't understand though is why you are so worried about it? If someone called this file it should just output a quote to the browser.
though maybe I am missing something.
As for my reasons for wanting to secure script access, it's mostly because I don't want the sort of drain on my bandwidth that I've seen from hotlinking images. Not to mention the extra CPU usage it would cause.
I think it is possible to use SSI without making the files publicly accessible, but I'm on shared hosting that doesn't allow me to configure Apache for such adventures.