Step 1
------------------------------------------
Now, for limiting direct access to those files you wanna protect from being access without being on your index for example, what we have to do is add a define on our index by adding this at the start of your code:
<?php define("ON_OUR_SITE", true); ?>where it says ON_OUR_SITE you can change it for whatever you want...
Step 2
------------------------------------------
after completing step 1, at the start of the code of each page you want to protect from being directly accessed you have to add something like this:
<?php if (!defined("ON_OUR_SITE")) { die ("Don't waste your time trying to access this file"); } ?>where it says ON_OUR_SITE you have to change it to whatever you put on your index...
so that is all you have to do... that will say "Don't waste your time trying to access this file" to who ever tries to access your protect files directly, but it will show it's content on your index without any problem.