In our website, some files in some directories do not allow customers to access them directly through the URL, so we need to use some ways to limit, and implement this feature:
.htaccess file established a .htaccess file
------------------------------------------------
# Options The .htaccess Files in Directories Can Override.
# Edit apache / conf / httpd.conf to allow allowoverride in .htaccess
# Allowoverride authconfig
# S t directory list from being shown
Options -indexes
# Controls Who Can Get Stuff from this Server.
ORDER DENY, ALOW
Deny from all
Allow from localhost php How does it achieve Phpif (EREGI ("Mainfile.php", $ PHP_SELF)) {
Header ("Location: Index.php");
DIE ();
}
?>