Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

local staging magento site redirecting to live site

I followed this tutorial to set up a local staging version of our magento site. Locally it is running on an ubuntu & an apache server.

Everything seemed to work fine but when I point a browser at the staging site it redirects to the live site.

So far I've tried:

  1. changing in the url entries in mg_core_config_data table in the local database
  2. clearing the browser cache & cookies
  3. Changing the .htaccess file to include RewriteBase /localhost/

None of these worked, I've read that the app/etc/local.xml file may have some settings that could be causing this, but I can't find them.

Should I add some kind of rewrite to the .htaccess file ???

Any help would be appreciated.

This is my app/etc/local.xml file:

<?xml version="1.0"?>
<!--
/**
 * Magento
 *
 * NOTICE OF LICENSE
 * Blah Blah
-->
<config>
    <global>
        <install>
            <date><![CDATA[Mon, 07 Oct 2013 06:25:58 -0500]]></date>
        </install>
        <crypt>
            <key><![CDATA[de1v6an96abmo8kdhho2qbqrmcal3z0w]]></key>
        </crypt>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[mg_]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[localhost]]></host>
                    <username><![CDATA[??????]]></username>
                    <password><![CDATA[??????]]></password>
                    <dbname><![CDATA[??????]]></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[db]]></session_save>
     </global>
     <admin>
        <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
     </admin>
</config>
like image 535
Holly Avatar asked Dec 16 '13 23:12

Holly


2 Answers

Solved!

The Redirect problem was due to Magento cache. I Simply deleted everything from the var/ folder of my Magento site. After that I cleared my browser's cache/cookies for good measure & it worked!

like image 81
Holly Avatar answered Sep 28 '22 18:09

Holly


for me, the problem was :

  • local.xml updated
  • List item
  • secure/base_url and unsecure/base_url updated
  • All copied properly
  • var folder emptied

still redirecting to live website.

The file permission of the magento folder were 775, I changed it to 777 and voila.

Note that this has the usual security issue and a chown www-data:www-data would be preferable. My dev server does not need to be too secured so the 0777 simplifies a bit.

like image 20
Memes Avatar answered Sep 28 '22 18:09

Memes