In this post we will show you few ways to change base_url for Magento2.3. Using phpMyAdmin or MySQL command line to change base_url.
Change base_url settings with phpMyAdmin
1. Go to your database by phpMyAdmin then open core_config_data
table
2. Find the rows web/unsecure/base_url and web/secure/base_url and click Edit next to the corresponding lines. Change the base URL to the intended string, and click OK. Replace https://www.example.com/ with your appropriate domain url (trailing slash necessary) and if you’ve installed in a subfolder append it with a / after it. If you haven’t received your security certificate and enabled TLS/SSL yet, use http instead of https
3. Within the Value column, update the value of each specific secure and unsecure URL to the intended URL.
4. Flush the Magento cache and your site should load with new set base_url.
bin/magento cache:flush
Change base_url settings with MySQL command line
1. Login your RDS database from EC2 instance with following command line:
mysql -h RDSEndPointAddress -uadmin -p
2. Open core_config_data
table.
use magento_db;
3. Update base_url by using these commands:
update core_config_data set value = 'http://www.example.com/' where path = 'web/unsecure/base_url'; update core_config_data set value = 'https://www.example.com/' where path = 'web/secure/base_url';
Notes: Replace unsecure http://www.example.com/ and secure http://www.example.com/ (if you have SSL/TLS enabled, else https should be http) with your appropriate domain url (trailing slash necessary) and if you’ve installed in a subfolder append it with a / after it.
4. Validate your base_url:
select * from core_config_data where path like '%base%url%';
5. Then flush Magento cache:
bin/magento cache:flush
Change base_url settings with Magento command:
1. Change Secure URL
bin/magento setup:store-config:set --base-url-secure="https://www.example.com/"
2. Change Unsecure URL
bin/magento setup:store-config:set --base-url="http://www.example.com/"
3. Flush Magento cache
bin/magento cache:flush