Contact
Site: US UK AU |

How to change Magento base URLs

How to change Magento base URLs

Overview
This article gives three methods to change Magento Base URLs.  

Contents

Attention

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 (No 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 disable maintenance mode in Magento
Added on Fri, Dec 15, 2017
How to flush your Magento cache
Added on Tue, Mar 1, 2016
How to disable caching in Magento
Added on Tue, Nov 5, 2013
What are some useful Magento scripts?
Added on Mon, Oct 13, 2014
How to configure CDN access for Magento
Added on Wed, May 16, 2018
How to set up outgoing SMTP email for Magento
Added on Thu, Oct 6, 2016
How to enable CAPTCHA for user creation in Magento 1.x
Added on Fri, Aug 18, 2017
How to install Magento CE v1.8 and later
Added on Thu, Mar 6, 2014
How to conserve disk space in Magento
Added on Fri, Jan 17, 2014
How to remove index.php from your Magento site URL
Added on Wed, May 31, 2017