Jump to content

What are all the index.php files in the folders good for?


Recommended Posts

Are they simply there so that no user can access the "Index of"-page?

 

That would be my guess, too... :)

 

It's kind of universal file-based way for this kind of protection. For example, one might think of including .htaccess files with a proper directive for turning off Directory Indexes, but this would only work with Apache and not with, say nginx...

Edited by parsifal (see edit history)
Link to comment
Share on other sites

  • 2 years later...

yes, index.php file in each directory is for security purposes. Without this file each user will be able to check directories / files structure. It's definitely bad.

 

Cool. Thanks.

 

I have another silly question which is "should i change the content of index.php file? for example some people changed the path of the header location depends on folder level. is it correct or no need to change???

 

 

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
 
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
 
header("Location: ../");

 

exit;
Link to comment
Share on other sites

×
×
  • Create New...