Site: US UK AU |

How to change Magento base URLs

How to change Magento base URLs

This article gives three methods to change Magento Base URLs.  



These methods work only for sites using a single-store Magento setup, not a multi-store setup.

Method 1: Magento Admin Panel

  1.  Log in to your Magento Admin Panel. On the upper right, click System > Configuration.

  2. From the main menu, under the General list, click Web.

  3. Open the Unsecure and Secure drop-down lists, locate the base URL line, and replace this with the new URL
  4. Clear the Magento cache and your browser's cache. The site should now load properly.  

Method 2: PhpMyAdmin

  1. Log in to your SiteWorx account.
  2. From the main menu, click Hosting Features > MySQL > PhpMyAdmin.

  3. You will see the main menu for phpMyAdmin. On the left, locate and click the name of the Magento database corresponding to URL you want to change.   

  4. You will see a list of all the tables in the database in alphabetical order.  Search for the core_config_data table and click Browse.

  5. Expand the viewing area of phpMyAdmin. At the bottom of the main panel, locate the grey box and change the Number of rows to a larger number, such as 30.
  1. Locate the rows web/unsecure/base_url and web/secure/base_url and click Edit next to the corresponding lines. Change the base URL to the intended string, and click OK.
  2. Within the Value column, update the value of each specific secure and unsecure URL to the intended URL.
  3. Flush the Magento cache, and the site should load with the set base URLs properly now.   

Method 3: Command line

Attention: Only use this method if you are familiar with the command line and MySQL queries. 

Attention: Angled brackets (<>) indicate placeholder information. Replace the brackets and everything between them with the indicated information.

  1. Use SSH to log in to the server hosting the Magento installation's database. 
  2. Enter the following command:

    mysql -u <$database_user> -p <$database_name>

  3. Enter your password when prompted.
  4. Access their database using the following command:

    use <database_name>

  5. Execute: 

    select * from core_config_data where path like '%base%url%';

  6. This will display the current base_urls set in Magento.
  7. To change the base URLs, execute:

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


For 24-hour assistance any day of the year, contact our Support Team by email or through the Client Portal.

Article Rating (3 Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
How to change your Magento 1.x password
Added on Wed, Nov 30, 2016
How to configure Magento to use your SSL certificate
Added on Mon, Feb 29, 2016
How to disable maintenance mode in Magento
Added on Fri, Dec 15, 2017
How to disable caching in Magento
Added on Tue, Nov 5, 2013
How to patch your Magento 1 store
Added on Thu, Oct 18, 2018
How to add admin users in Magento 1.x
Added on Wed, Dec 7, 2016
How to improve the security of your Magento store
Added on Wed, Nov 12, 2014
How to configure the Magento Product Importer (Magmi)
Added on Mon, Jan 26, 2015
What is Turpentine?
Added on Thu, Aug 28, 2014
How to back up your Magento 1 store
Added on Thu, Oct 18, 2018