How to change the base Magento URL?
You may need to change the URL or domain name for your Magento store. Therefore, in this guide, you will learn how to change the base URL of your Magento website. In Magento 2 to get the base URL changed, do the following:
Step 1. Navigate to Stores > Settings > Configuration.
Step 2. Go to the General tab and select Web settings.
Step 3. Expand the Base URL section and specify the following settings:
- Base URL - Enter the complete base URL of your store. End the URL with a slash to make it extendable with URL Keys.
- Optional settings to specify the alternate location for the base URL: Base URL for Static View Files and Base URL for User Media Files. Enter the path starting with the following placeholder:
Step 4. Save config to save all Magento 2 store URL changes.
Secure Base URL can be configured in the same way in the Base URLs (Secure) window. You will see the same settings as in the Base URL section, except in Use Secure URLs on Storefront and Use Secure URLs in Admin settings. You will need to select the Yes option to improve security.
You can also Enable HTTP Strict Transport Security (HSTS) and Upgrade Insecure Requests by selecting Yes in the dropdowns. Don’t forget to save the config after completing all the settings.
Changing your site URL can help improve the SEO performance of your Magento store. To make your site as successful as possible in terms of SEO, you can use the SEO Toolkit extension. The extension functionality can help you automate routine SEO tasks and attract additional organic traffic to your site. Among the many available features, you will find such as:
- Auto redirect from 404 to Search Results
- SEO templates for a custom page by URL
- Toolbar with key SEO stats on the storefront and more.