4

My Magento dev site has been set up and the homepage is working for it, however all the urls around the site including the backend admin are redirecting the the live site.

I have created a new database for the dev site I have changed the relevate base URLS in the core_config_data to match the dev site. I have changed the local.xml to reference the dev database I have eptied the var/cache, var/sessions and var/tmp I have commented out/deleted the re-directs in the .htaccess files

Have I missed anything because I can not find a way to get this problem solved. Any help would be amazing. Thank you in advance.

5
  • Do the prod and dev sites share a server? Is the dev database a copy of the production database (except for those changes in core_config_data)? Did you reindex everything? What is your server setup look like (or you can just say the host and I can figure it out).
    – kab8609
    May 28 '14 at 15:14
  • Yes thet do share a server. The database is a copy (except the changes). I cannot reindex in the backend as it redirects to the live site backend. The host is Cronos Internet. Hope thats helps thanks :-)
    – Ads
    May 28 '14 at 15:22
  • Can you login via SSH? If so can you run this command in the dev root folder? "php shell/indexer.php --reindexall"
    – kab8609
    May 28 '14 at 15:32
  • Did you clear the cache? Your old path might be in the cache. Also be sure to really clean the cache i.e. check for existence of /tmp/magento
    – Alex
    May 28 '14 at 15:57
  • Yes I have just done that and still all urls are linking to the live site. The live site has an SSL which it may be falling back to that when going to backend. I have no clue at this point.
    – Ads
    May 28 '14 at 16:00
5

We had the problem, that APC was used for caching and the prefix was the same, so the same cache was used.

Beside of this, be sure, that you changed ALL the urls in core_config_data

To configure APC you add this to your local.xml:

<global>
    <cache>
        <backend>apc</backend>
        <slow_backend>database</slow_backend>
       <prefix>prefix</prefix>
    </cache>
</global>

Be sure, that the prefix is NOT the same on your live and dev machine.

Beside of this, think about moving your dev environment to another machine, because if you kill your dev system, this might affect the live system. No good ground for experiments!

9
  • I have 100% changed all the URLs in core_config_data. I cleared the cache in tmp/magento/var and doing this it worked fine but somehow 1/2 an hour later it reverted back to re-directing and also affected the live site (which is on the same sever) messing it up because now the SSL is attempting to load the stylesheet in a non-secure manner so it isn’t displayed. Is there anything that I am missing? Has clearing that cache uncovered an error in the live site? Is there a different way to do this if the site has SSL have to say I am a bit stuck on this one any help you could give would be amazing.
    – Ads
    May 29 '14 at 8:26
  • this sounds like two magentos using the same cache space... redis, memcache, apc? May 29 '14 at 8:38
  • I am not sure if it is redis, memcache, apc I will try to find out. What appears to be the problem is that as the dev site is now unable to call the local.xml file.
    – Ads
    May 29 '14 at 10:14
  • They are using APC
    – Ads
    May 29 '14 at 11:11
  • added more infos May 29 '14 at 11:16
1

I have solved the problem I had in my app/etc a config.xml & local.xml but also localbackup.xml, local-copy.xml, local.xml.additional and local.xml.template. They were here when I was handed this site and deleting all of them solved the problem. I did not know that they would have affected the local.xml. Thanks you too all for all of your help. SOLVED!!!!!

1
  • For your information: Magento loads all xml files in app/etc. In this order: local.xml, all other, (system is initialized), all app/etc/modules/*.xml, then the local.xml again if a problem happens in between, it might happen what you observed. May 30 '14 at 10:37
1

I was facing the issue today too

  • base_urls all configured
  • index.php got hit (no server redirect like in .htaccess)
  • no additional .xml files in app/etc
  • correct configured app/etc/local.xml
  • all known caches are disabled/cleared

It turned out it was caused by a not writeable /var folder so no var/cache and var/session could get created. I've still now clue from where Magento pulled the original url but at least updating the permissions solved my issue.

0

This sneaky, simple one had me dumbstruck for a few hours of checking the fiddly stuff:

My secure/non-secure site urls were set to be the live site url, rather than the production one in config > general > web under the store view scope

I'd set the correct urls in the website view, but at some point i'd made it granular.

Hope this saves someone else time in future.

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.