Can any one tell me the logical difference between of using index.php in root directory and pub directory when we go live to point domain then which index.php should be pointed by domain?
Magento2 – Difference Between Root Index.php and Pub Directory Index.php
domainmagento2
Best Answer
One is at the absolute top level of Magento 2’s distribution folder. The second is inside the "pub" folder. There are also separate but similar .htaccess files for each of these index.php files.
The file you want to use for your Magento system’s root folder is pub. This is a modern PHP framework convention, and is one layer in a layered approach to protecting your PHP and configuration files from being exposed to the world. However, Magento still ships with the root level index.php because many hosting companies make changing this webroot difficult and/or impossible.
Hint : Why Magento 2 have 2 possible root folder?