I just tried hiding my includes by putting them in a directory with only owner permissions set, and alternatively by giving the files themselves only owner permissions. This worked fine but then they were no longer accessible to the pages that they were included on.
My question - what's the best way to assure that no one may stumble upon your includes by themselves?
Is there PHP code that could go in the head of the include so that if it is accessed directly it will switch to either some other page or a page that it is intended to be included on?
Bookmarks