local staging magento site redirecting to live site
Asked Answered
M

5

5

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>
Memorial answered 16/12, 2013 at 23:59 Comment(0)
M
17

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!

Memorial answered 17/12, 2013 at 0:27 Comment(2)
saved my time perfect answerEffort
More than that, clear your browser cache too. Mine was problem with browser cache. I cleared it. IT worked.Fourflush
I
3

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.

Iatric answered 21/5, 2014 at 15:58 Comment(0)
A
1

We should always delete var/cache after moving to another server or doing any major change in Magento.

Aubyn answered 17/12, 2013 at 10:21 Comment(0)
J
0

The problem is because of permission.I solved it after setting permissions to folders.

sudo chown -R group:user .
sudo find . -type f -exec chmod 777 {} \; && sudo find . -type d -exec chmod 777 {} \;

Please use chmod parameter, what is desired like 655,755 or whatever you need depends upon folder.

Jandel answered 14/2, 2017 at 11:26 Comment(0)
C
0

For me finally what worked was

php shell/indexer.php --reindexall via ssh. It appears, quite logically so, that after the files have been copied over from a previous live installation the urls still point to the old store and hence have to be reindexed, in my case via ssh.

Hope it works for others too !

Cerussite answered 26/8, 2017 at 12:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.