Rommeo Posted December 6, 2010 Share Posted December 6, 2010 I have my template files and some functions in my server which are available for direct reach. like ; my "index.php" file includes "loginpage.php" form which is ok when I enter www.site.com/index.php but also when I enter to www.site.com/loginpage.php it works and shows me just login page. So this is what I dont want. How can I prevent to reach the files directly like this, I want them to work just for other pages of my website, not for directly seeing. By the way can this problem also be solved by hosting settings or mod_rewrite ? Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted December 6, 2010 Share Posted December 6, 2010 This can be solved by htaccess rules but here is one common way: //index.php define('SOMETHING', true); //loginpage.php defined('SOMETHING') or die(); //or defined('SOMETHING') or header('Location: index.php'); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.