Question

I am developing an e-commerce site on Magento and have stumbled across a bit of a problem that I can't seem to solve.

I setup the site with Turnkey Linux's Magento application and whilst configuring it I was asked to "Enter the domain to serve Magento." to which I entered shop.example.com

Now when I first started editing the site I could access it from shop.example.com and the servers IP address. Everything was working fine, until...

I realized that the server need to be upgraded from a micro instance to an m1.medium instance on AWS and also that I would be working from home as well so it would be helpful to move the site to a live testing domain that I already own.

So I upgraded the server and changed the DNS records on the domain to point the subdomain shop. to the servers IP. Now when you try to access the site everything redirects to shop.example.com which is broken.

Not really sure what the next step is or where the problem lies so I shall outline a few things I've looked into:

  • Checked my computers hosts file to see if I added some sort of loop and forgot, nothing incriminating there.
  • Connected to the server via ssh & sftp to check that everything is still there which it is.
  • Connected to the sites webmin to see if that was still there and it is still alive and well.
  • Searched google for Magento, Turnkey and Stackoverflow for related problems but haven't found anything similar enough to solve it.

Any help/advice is greatly appreciated. I can also provide any other information that might help get a clearer picture.

Thanks :)

Was it helpful?

Solution 2

If you have access to the database (presumably via SSH), check the core_config_data table.

This table contains the domain configured for each store scope. For default scope check the "value" column of rows where path is "web/unsecure/base_url" (and web/secure/base_url). Ensure this is definitely set to the domain you wish to use.

SELECT `value` FROM `core_config_data` WHERE `path` = "web/unsecure/base_url";

If you try to access the store using a domain other than the one configured in core_config_data, Magento will attempt to redirect you, which I think is what you're experiencing.

OTHER TIPS

First you need to update the urls in your database

UPDATE core_config_data
SET `value` = 'http://my-site.com/'
WHERE PATH LIKE '%base_url'

Then clear /var/cache, /var/session after changing base_urls and when you have access to your system reindex your URL_rewrite index. Clearing cache and sessions is necessary because your config is cached and clearing it forces a reread of the configuration data from the core_config_data table and reestablishment of sessions with the proper information.

See

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top