简体   繁体   中英

Why there is index.php and .htaccess into all Prestashop subfolder?

In pratically each sub folder of Prestashop, you can found an index.php file that contains :

<?php       
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;

and an .htaccess one that contains :

Order deny,allow
Deny from all

I understand that .htaccess one prevent the user to access that folder but I'm more curious about what they do with index.php, what does it do exactly ?

The .htaccess add a security by removing access to the current directory with the "Deny from all" rule.

The index.php is in every folder to prevent direct access to folders. For example if you type in browser www.myshopurl.com/modules, you will be redirected back to home page since you're not suppose to access or view the contents of this folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM