My magento site is stored in a sub-folder of my root domain mydomain.com/magento - I am trying to get the site working at mydomain.com (leaving admin available at mydomain.com/magento/admin).

I have updated the base url store view in admin panel to mydomain.com/ as suggested in another post on stack exchange. I have also copied the index.php to the root folder and updated this line (47):

$mageFilename = MAGENTO_ROOT . '/magento/app/Mage.php';

I have only updated the line in the index.php located in root - not the one located in the /magento/ folder.

Unfortunately, something has gone wrong as when I visit the site via mydomain.com/ I get a 500 error. The site is still accessible via mydomain.com/magento and the admin is also fine.

Can anyone please suggest a fix?

1 Answer 1


In 1.9 this was resolved by adding /magento/ to every directory reference in the index.php file, line 42-65 (see detail below).

$compilerConfig = MAGENTO_ROOT . '/magento/includes/config.php';
if (file_exists($compilerConfig)) {
    include $compilerConfig;

$mageFilename = MAGENTO_ROOT . '/magento/app/Mage.php';
$maintenanceFile = 'maintenance.flag';

if (!file_exists($mageFilename)) {
    if (is_dir('downloader')) {
        header("Location: downloader");
    } else {
        echo $mageFilename." was not found";

if (file_exists($maintenanceFile)) {
    include_once dirname(__FILE__) . '/magento/errors/503.php';

require MAGENTO_ROOT . '/magento/app/bootstrap.php';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.