WebHostingPeople Blog

How Can We Help?

Change Magento Base URL without accessing Admin Dashboard

You are here:

Magento is a widely employed framework to establish online retail stores. You can construct and handle all types of eCommerce stores using Magento. In this tutorial, we will examine how to modify the Base URL of our Magento website without gaining entry to the admin dashboard.

There may exist occasions when you desire to modify the root URL of your website. For instance, if you want to adjust the website URL from http://domain.com to http://www.domain.com or want to substitute the HTTP URL with HTTPS. You can refer to the subsequent approaches for changing the root URL.

In this tutorial, we will discuss how to change the Magento website URL without accessing the Magento admin dashboard. Sometimes, during periods of system outages, you may be unable to access the Magento admin dashboard. In such situations, you can employ any of the two methods outlined in this tutorial to update the root URL of your Magento website.

Method 1: Modifying URL via phpMyAdmin

1) Log in to cPanel.

2) Navigate to Databases >> phpMyAdmin.

Change Magento Base Url

3) Select the database associated with the Magento website.

4) Locate the table “core_config_data” and click on it.

Change Magento Base Url

5) Locate the following lines by clicking the edit option:

web/unsecure/base_url: Enter the base URL without security (eg: http://domain.com) for your website. Make sure that the URL ends with a forward slash (/).

web/secure/base_url: Enter the unsecured base URL (HTTP) to secure base URL (HTTPS).

6) Click the “Go” button to apply the changes.

If you are unable to access phpMyAdmin, you can employ the command-line approach to update the base URLs 

Method 2: Utilizing the Command-line

1) Log in to your server via SSH.

2). Enter the following command:

mysql -u $database_user -p $database_name

Replace the database_user and database_name with the appropriate database username and password for your website.

3) Access the corresponding database using the command:

use <database_name>

Replace database_name with the name of your database.

4) Execute the following command to display the current base URLs for your website:

 select * from core_config_data where path like ‘%base%url%’;

5) Use the following command to update the base URLs:

 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’;

This is how you can update the base URL of your Magento website without accessing the Magento admin dashboard. If you require further assistance with the process, please leave a comment below.

Changing Magento Root URL without Accessing Admin Dashboard

Post Your Comment