Magento 2 seems to be moving in a more Symfony/Zend 2/modern direction by splitting out the source folder (app
) from the publicly browsable folder (pub
). This is good, but the default distribution has a little weirdness — there’s two index.php
files. There’s the one you’d expect in pub
pub/index.php
and then there’s another one at the root level of the project
index.php
This means you can set either folder as the root in your web server, and then tell Magento where the pub
folder actually is with something like this
#File: pub/index.php
$params = $_SERVER;
$params[Mage::PARAM_APP_URIS][Mage_Core_Model_Dir::PUB] = '';
$entryPoint = new Mage_Core_Model_EntryPoint_Http(new Mage_Core_Model_Config_Primary(BP, $params));
Hopefully the root level index.php
file is a temporary development thing. If this ships in the final version, we’ll see a lot of users needlessly exposing their app
folder to the web.
In the meantime, you’ll want to avoid hard coding any javascript/css asset paths, as the <script/>
and <link/>
tag paths will vary depending on which index.php
a user has their system configured to serve.