Magento – Moving Magento installation from localhost to sub-directory in server root

ce-1.9.0.1localhost

The title says it all .. however I'm having a problem.

I transferred my installation from localhost to a sub-directory in the server root name test.

I edited app/etc/local.xml to include the correct credentials as well as updating base URL within the core_config_data table.

When going to the url http://mydomain/test all I get is a blank page. Of course the admin doesn't work either. When I put the Magento installation in the server root it works fine but not in a sub-directory.

Does anyone have a clue as to why this happens?

If you need any more info please let me know. I'm using Magento CE 1.9.0.1

Best Answer

If you are using rewrite directives (SEO URLS) you need to edit your htaccess and change the RewriteBase to

############################################
## you can put here your magento root folder
## path relative to web root

    RewriteBase /test/

Then manually rename the 'var/cache' folder and make sure it gets recreated when you try and reload the index.php


Edit:

here is a smple local.xml file

<config>
    <global>
        <install>
            <date><![CDATA[Wed, 11 Feb 2015 12:25:38 +0000]]></date>
        </install>
        <crypt>
            <key><![CDATA[bf0accb767a157c6da44eca568a92142]]></key>
        </crypt>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[localhost]]></host>
                    <username><![CDATA[root]]></username>
                    <password><![CDATA[root]]></password>
                    <dbname><![CDATA[local_magento_com]]></dbname>
                    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                    <model><![CDATA[mysql4]]></model>
                    <type><![CDATA[pdo_mysql]]></type>
                    <pdoType><![CDATA[]]></pdoType>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>
        <session_save><![CDATA[files]]></session_save>    
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>
Related Topic