Magento - How to manually change the base URL / domain?

I did a search for this, but I can only find answers on how to do this through the admin panel (which I cannot achieve).

I have a live Magento installation that I'm going to do a new development into.

So, I am setting up the development site on a subdomain of the main site URL (http://test.mydomain.com)

The problem that I encountered is that somewhere in the boot block of Mage :: run () the site is redirected to the www subdomain.

I changed the following 2 entries in the database:

mysql> select * from core_config_data where value like '%mydomain.com%'; | config_id | scope | scope_id | path | value | +-----------+---------+----------+------------------------+-------------------------------+ | 2 | default | 0 | web/unsecure/base_url | http://test.mydomain.com/ | | 3 | default | 0 | web/secure/base_url | http://test.mydomain.com/ | 
  • I also guaranteed that config "local.xml" points to the new dev DB.
  • I also deleted all / var / cache
  • I also deleted all htaccess subdomain redirects
  • I also restarted Apache.

No luck, still redirecting.

What am I missing?

+8
magento
source share
2 answers

So, it turns out that the problem was that Apache did not have write permissions to the WEBROOT/var directory, so Magento used its cache from the /tmp system directory. (thanks for the tip, Fiasco Labs !)

If someone gets here from Google, I will repeat the steps ...

How to manually change a domain in Magento

  • Refresh the core_config_data table to edit the two entries for web/unsecure/base_url and web/secure/base_url
  • Delete contents WEBROOT/var/cache
  • Updating / editing any .htaccess domain redirects you may have added
  • Restart apache
  • Make sure Apache has write WEBROOT/var in WEBROOT/var
  • If you created a new database, make sure that WEBROOT/app/etc/local.xml .
  • If you use Chrome, clear your browser cache! (Chrome caches 301s)

What about that. Greetings.

+14
source share

Try using the "FLUSHALL" command on redis-cli, maybe you have a cached database.

It worked for me.

0
source share

All Articles