<Files yourinclde.php> order allow,deny deny from all </Files>in php file
<?php if(!defined('restrict')) { die('Direct access not permitted'); exit(); // Redirect to 404 page } ?>
include file using main page define restrict variable
<?php define('restrict', TRUE); ?>