To change the Base URL in Magento, follow these steps:
- Log in to your Magento Admin panel.Open your preferred web browser and enter the URL of your Magento store followed by “/admin” (e.g. “www.example.com/admin“) to access the Admin panel. Enter your login credentials to log in.
- Click on “Stores” from the main menu and select “Configuration” from the drop-down menu.From the Magento Admin panel’s main menu, click on “Stores.” A dropdown menu will appear, and from that menu, click on “Configuration.”
- In the left-hand menu, click on “General” and then select “Web.”On the next page, a list of configuration sections will be displayed on the left-hand side of the screen. Click on the “General” section to expand it, then select “Web.”
- In the Web section, find the “Base URLs” section.In the “Web” section, you will see several subsections, including “Base URLs.” It will show you the current store’s Base URL and Secure Base URL.
- Change the Base URL and Secure Base URL as per your requirements.In the “Base URLs” section, replace the current URL in the “Base URL” and “Secure Base URL” fields with your new desired URL. Make sure to include the “http://” or “https://” prefix, depending on whether you want to use a secured or unsecured connection.
- If you want to use the same URL for both secure and unsecured connections, select the checkbox next to “Use Secure URLs (HTTPS)” to enable it.If you want to use the same URL for both secured and unsecured connections, you can enable the “Use Secure URLs (HTTPS)” option. Tick the checkbox next to “Use Secure URLs (HTTPS)” to enable it.
- Once you have made the changes, click on the “Save Config” button in the top right corner to save your changes.
After making the changes, click the “Save Config” button in the top-right corner of the page to save your new Base URL settings.
Note: After changing the Base URL, Magento may require you to clear the cache and reindex the site to ensure the changes take effect. To clear the cache, go to the Cache Management section in the System tab and click on the “Flush Magento Cache” button. To reindex the site, go to the Index Management section in the System tab and click on the “Reindex Data” button.