Table of contents
Each website in a Magento installation has a Base URL that is assigned to the frontend and to the Admin.
If you have a security certificate for your domain, you can configure each or both base URLs to operate over a securely encrypted SSL channel. Unsecure base URLs begin with “http,” and secure base URLs begin with “https.”
In case you want to change your Magento site Base URLs, you can apply one of these below methods.
In Magento backend
Magento 1
- Configure the unsecure base URLs:
- In your Magento backend, go to System > Configuration.
- On the left menu, under General section, click Web.
- Expand Unsecure section. Enter the unsecure (http) Base URL for your store. Make sure to end the URL with a forward slash (“/”).
- (Optional) If you don’t plan to use a secure base URL for the Admin, do the following:
a. Expand Secure section.
b. Enter your unsecure (http) Base URL. The URL should be the same in both the Secure and Unsecure sections. - Click the Save Config button.
- Configure the secure base URLs:
If your domain has a valid security certificate, you can configure the URLs for either the frontend and Admin—or both—to run over a secure (https) channel.
- In your Magento backend, go to System > Configuration.
- On the left menu, under General section, click Web.
- Expand Secure section. Then, do the following:
- To use a secure (https) for the frontend, enter the Base URL, followed by a forward slash (“/”).
- If you want to run the entire storefront over a secure (https) channel, set Use Secure URLs in Frontend to Yes.
- If you want to run the entire Admin over a secure (https) channel, set Use Secure URLs in Admin to Yes.
- Click the Save Config button.
Magento 2
- Configure the unsecure base URLs:
- In your Magento 2 backend, go to Stores > Settings > Configuration.
- On the left menu, under General section, click Web.
- Expand Base URLs section. Enter the unsecure (http) Base URL for your store. Make sure to end the URL with a forward slash (“/”).
- (Optional) If you don’t plan to use a secure base URL for the Admin, do the following:
a. Expand Base URLs (Secure) section.
b. Enter your unsecure (http) base URL into Secure Base URL field. The URL should be the same in both the Base URLs and Base URLs (Secure) sections. - Click the Save Config button.
- Configure the secure base URLs:
If your domain has a valid security certificate, you can configure the URLs for either the storefront and Admin—or both—to run over a secure (https) channel.
- In your Magento 2 backend, go to Stores > Settings > Configuration.
- On the left menu, under General section, click Web.
- Expand Base URLs (Secure) section. Then, do the following:
- To use a secure (https) for the storefront, enter the Secure Base URL, followed by a forward slash (“/”).
- If you want to run the entire storefront over a secure (https) channel, set Use Secure URLs on Storefront to Yes.
- If you want to run the entire Admin over a secure (https) channel, set Use Secure URLs in Admin to Yes.
- Click the Save Config button.
Using command line
- Use SSH to log in to your Magento hosting server.
- Enter the following command:
mysql -u $database_user -p $database_name
- Enter your password when prompted.
- Access the database using the following command, where database is the database name.
use database
- Run the following command. This will display the current base_urls set in Magento.
select * from core_config_data where path like '%base%url%';
- To change the base URLs, run the following commands:
update core_config_data set value = 'http://example.com/' where path = 'web/unsecure/base_url'; update core_config_data set value = 'https://example.com/' where path = 'web/secure/base_url';
Hope this helps!
For more actionable Magento tutorials like this, keep reading the Magento section on our Blog.
Further Reading:
How to Change Magento 2 Logo
A Completed Guide to Fix Magento Admin Login Not Working Issue
How to Generate and Submit Google Sitemap (.XML) for Your Magento 1 & 2 Store