How to change Magento base URLs

Figure 1. Magento Admin Panel.

  1. On the upper right, clickSystem>Configuration.

Figure 2.System > Configuration.

  1. From the menu on the left, under theGenerallist, clickWeb(Figure 3).

Figure 3.General > Web.

    1. Open the Unsecure and Secure dropdowns, locate the baseURLline, and replace this with the newURL.
  • Clear the Magento cache and your browser’s cache. The site should now load properly.

Method 2: Change Magento base URLs with PHPMyAdmin

  1. Log in to your SiteWorx account.
  1. From the menu on the left, clickHosting Features>MySQL> PhpMyAdmin(Figure 4).

Figure 4.Hosting Features>MySQL> PhpMyAdmin.

  1. You will see the main menu for phpMyAdmin. On the left side of the screen, locate and click the name of the Magento database corresponding toURLyou want to change. Figure 5. Magento database selection.
  1. You will see a list of all the tables in the database in alphabetical order. Search for thecore_config_data tableand clickBrowse(Figure 6).Figure 6. List of tables andcore_config_data table.
  2. Expand the viewing area of phpMyAdmin. At the top and bottom in the main panel, locate the grey box and change theNumber of rowsto a larger number, such as 100.

Figure 7.Number of rowsfield.

  1. Locate the rowsweb/unsecure/base_urlandweb/secure/base_urland clickEditnext to the corresponding lines. Change the baseURLto the intended string, and clickOK.
  2. Within theValuecolumn, update the value of each specific secure and unsecureURLto the intendedURL.
  3. Flush the Magento cache, and the site should load with the set base URLs properly now.

Method 3: Change Magento base URLs with the command line

Attention:Do not attempt to change the base URLs unless you are familiar with the command line andMySQLqueries.

  1. UseSSHto log in to the server hosting the Magento installation’s database.
  2. Enter the following command, where$database_useris the database user and$database_nameis the database:
    • mysql-u $database_user -p $database_name
  3. Enter your password when prompted.
  4. Access their database using the following command,where database is the database name.


  1. Run the following command:

select * from core_config_data where path like ‘%base%url%’; 5. This will display the current base_urls set in Magento. 6. To change the base URLs, execute 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’;

Leave a Reply