Stepholt News

Base Url Change Magento 2

News Categories: Magentostepholt News

This article was published on: 04/16/21 7:47 PM

We come across this from time to time and it’s a common issue when a client changes their domain name due to a rebrand or upgrade from to .com

When we changed a Base Url Change Magento 2 there are several sets to take but as always please take this as a guide and backup, backup and backup before modifying your Database.

So, let’s dive straight and take an example that our client is changing from a to a .com. example to


Lets Go.

Log in to your server via SSH (we are using a terminal on a mac)

Connect to your Database – this can be controlled like this:

mysql -u root -p 

Enter password when asked.

Then we need to update baseurl in core_config_data:

UPDATE core_config_data
> SET value = ''
> WHERE path IN ('web/secure/base_url', 'web/unsecure/base_url')

Next Step

UPDATE core_config_data
> SET value = REPLACE(value, '', '')
>WHERE path = 'design/head/includes';

If this throws up an error use following: This happened to us on the MariaDB cloud server

Change the web/unsecure/base_link_url also:

UPDATE core_config_data
> SET value = ''
> WHERE path IN ('web/unsecure/base_link_url');


Then changed Store Url

php bin/magento setup:store-config:set --base-url=""

php bin/magento setup:store-config:set --base-url-secure=""

Finally to finish clearthe cache:

php bin/magento cache:flush


Website Design
Website Development
Website Marketing