How To Change Magento Base URLs For Your Website?

How To Change Magento Base URLs For Your Website?

Let us look at the 3 simple ways on how to change Magento base URLs for your website. We will go step-by-step with each method to make it easier to implement.
The three methods to change Magento base URLs include:

  • Via Magento Admin Panel
  • Command Line
  • PhpMyAdmin

The first method that we will discuss to change Magento base URLs is via Magento Admin Panel. Here are the steps:

  1. Log in to your Magento Admin Panel
  2. On the upper right of the screen, click System > Configuration
  3. On the left menu, under the General list, click Web
  4. Go to the ‘Unsecure and Secure dropdown’, and then replace the old base URL line with the new URL.
  5. After that, clean the Magento and your browser’s cache. And that’s it, you’re done and the site will open now.

The second method that we will discuss to change Magento base URLs is via Command Line method. Here are the steps:

  1. Login to the server hosting Magento database via SSH
  2. Enter the following command, where
    $database_user is the database user and $database_name is the database:
    mysql -u $database_user -p $database_name
  3. Enter your password when required
  4. Access their database using the following command, where database is the database name
    use database
  5. Then, run this command
     select * from core_config_data where path like '%base%url%';

6. The command will display current base_urls set in Magento.

7. Now to change base URLs, run the following commands

update core_config_data set value = 'http://domainname/' where path = 'web/unsecure/base_url';
update core_config_data set value = 'http://domainname/' where path = 'web/secure/base_url';

The third method that we will discuss to change Magento base URLs is via PhpMyAdmin. Here are the steps:

  1. Login to your SiteWorx account
  2. On the left menu, click Hosting Features MySQL > PhpMyAdmin
  3. You have arrived at the PhpMyAdmin main menu. Now, on the left click on the Magento database name that corresponds to the URL you wish to change.
  4. Then, you will see a list of all the tables in the database sorted alphabetically.
     Search for the core_config_data table and click Browse          
    
  5. Expand the viewing area of PhpMyAdmin. At the top and bottom in the main panel, find a gray box and increase the number of rows to a higher number, such as 200.
  6. Find the row
    web/unsecure/base_url and web/secure/base_url

    and then click Edit next to the respective lines. Change the base URL to the intended string, and press OK.

  7. In the Value column, change the value of each specific ‘secure and unsecure’ URL to the desired URL.
  8. Next, flush the Magento cache, and now your Magento website will ideally load with the set base URLs.

Hence, now you understand the 3 methods step-by-step on how to change the base URLs for your Magento website. In case of any queries, reach us at info@rltsquare.com

Back to blog