I am currently writing some php scripts will include different HTML files depending on conditions. Everything is running fine with the scripts, but I would like to block direct access to these included HTML files except when called by the PHP include() function.
I know the best way to do this is to put the files into a folder not accessable through the httpd (above the web root), but I dont want to do this to keep things simple with the Web content developer who does all of our web graphics and HTML coding.
I have looked at the AddType directive for Apache, but this does not seem to do the trick since it just sets the content type of a file.
What I would like to do is this:
If i set the extension of a HTML file to inc - welcome.inc
I dont want a browser to access it by Typing in but only access it throught the script index.php that will include() it if the conditions are met.
Is this possible?
I know the best way to do this is to put the files into a folder not accessable through the httpd (above the web root), but I dont want to do this to keep things simple with the Web content developer who does all of our web graphics and HTML coding.
I have looked at the AddType directive for Apache, but this does not seem to do the trick since it just sets the content type of a file.
What I would like to do is this:
If i set the extension of a HTML file to inc - welcome.inc
I dont want a browser to access it by Typing in but only access it throught the script index.php that will include() it if the conditions are met.
Is this possible?