Categories
Magento

Magento 2 Base Url and CDN settings from MySql

Due to some Magento bug, sometimes it is difficult to setup Magento base URLs from admin configuration settings. Which is available under:
Store > Configuration > General > Web > Base URLs and Store > Configuration > General > Web > Base URLs (secure)

To have a settings like this:

Use following SQL commands.
Make sure you change the URLs accordingly.

UPDATE `core_config_data` SET `value` = 'http://prod.fastbazzar.com/' WHERE `core_config_data`.`path` = 'web/unsecure/base_url';
UPDATE `core_config_data` SET `value` = 'https://prod.fastbazzar.com/' WHERE `core_config_data`.`path` = 'web/secure/base_url';

UPDATE `core_config_data` SET `value` = 'http://prod.fastbazzar.com/' WHERE `core_config_data`.`path` = 'web/secure/base_link_url';
UPDATE `core_config_data` SET `value` = 'http://prod.fastbazzar.com/' WHERE `core_config_data`.`path` = 'web/unsecure/base_link_url';

UPDATE `core_config_data` SET `value` = 'http://dhc9e3ico1zl6.cloudfront.net/' WHERE `core_config_data`.`path` = 'web/unsecure/base_static_url';
UPDATE `core_config_data` SET `value` = 'http://d2cnvswvwy1c.cloudfront.net/' WHERE `core_config_data`.`path` = 'web/unsecure/base_media_url';

UPDATE `core_config_data` SET `value` = 'https://dhc9e3ico1zl6.cloudfront.net/' WHERE `core_config_data`.`path` = 'web/secure/base_static_url';
UPDATE `core_config_data` SET `value` = 'https://d2cnvswvwy1c.cloudfront.net/' WHERE `core_config_data`.`path` = 'web/secure/base_media_url';

Leave a Reply

Your email address will not be published. Required fields are marked *