We're using Magento Community edition version When we clone, the cloned site always redirects from the clone back to the live site.

We've tried the following two cloning methods: - using the Clone button in cPanel's Installation to produce a clone on the same server - porting the entire site to another server We encountered the same redirect problem with both methods.

How can we stop it from redirecting back to the live site?


Several steps involved in cloning or moving a website.

  1. Copy application files to new location and import database into MySQL. (best to do this with a tarball and database dump sql file, ftp has issues with things like getting .htaccess files to transfer, case to matter, etc.)

  2. (important!!) Make sure file/folder permissions and owner/group are correct so that var/ folder system is writable. Otherwise the Magento cache gets written in system /tmp instead of Magento var/ and only a server reboot or manual deletion will clear Magento cache out of /tmp . Also, not having var/ writable means that any drastic errors that write a file to var/report/ will fail to write any stack traces, compounding your installation heartburn.

  3. Make sure app/etc/local.xml points to the proper database and make sure if you back up the original local.xml that it doesn't end in .xml -> needs to be something like local.xml.sv1

  4. Change your database entries Unsecure BaseUrl for and Secure BaseURL to point to your new location (http://www.example.com and if ssl cert installed https://www.example.com respectively). Use phpmyadmin to look for the paths web/unsecure/base_url and web/secure/base_url in the core_config_data table.

  5. Manually clear your cache by deleting all the mage--? subfolders in var/cache

  6. If you were using the compiler on the previous site, disable compiler with SSH command line php shell/compiler.php disable from the Magento root.

  7. Attempt to load your admin backend, you should be on the new server URL now.

Following these steps should clear all the hiccups that cause Magento to adamantly redirect back to the old server. And believe me, I've had them all happen.

|improve this answer|||||

change in your database (the one of the clone site),

UPDATE `core_config_data` SET `value` = 'http://www.yourdomain.com/' WHERE `core_config_data`.`path` ='web/unsecure/base_url';
UPDATE `core_config_data` SET `value` = 'http://www.yourdomain.com/' WHERE `core_config_data`.`path` ='web/secure/base_url';

of course replacing http://www.yourdomain.com/ by the actual URL

Also, make sure that your Magento_root/app/etc/local.xml is pointing to the right database

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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