I want to block Url (external) access to PHP file in the folder "/mi-php/". So I created a .htaccess file within /mi-php folder with the following codes:
<Files *.php>
Order deny,allow
Deny from all
Allow from 127.0.0.1
</Files>
Sure, the php files are blocked from directly url access. However, when I try to call this php (/mi-php/jobdata.php) file using Ajax in one file on the webserver as follows:
$(document).ready( function () { $.getJSON("/mi-php/jobdata.php", function(data){ etc etc
It is also blocked. I thought calling by another file under the same website root directory is considered "localhost" access. I guess I am wrong. But how to make the php file accessible to only my own files under the root directory?