Get started today!◦ Full contract buyout ◦ Up to $1,000 credit ◦ Free migrations
Chat with us
Home » Magento Guide » Magento Admin » How to change base URLs in Magento 2 – Nexcess

How to change base URLs in Magento 2 – Nexcess

Three methods of changing base URLs for your single-store Magento 2 installation.

Get fast, reliable hosting for WordPress

Power your site with the industry’s fastest, most optimized WordPress hosting

Three methods of changing base URLs for your single-store Magento 2 installation.

Attention

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

Method 1: Dashboard

  1. Log in to your dashboard. From the main menu, select Stores > Configuration.
  1. 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.
    • If you do not know your password, click Forgot your password on the login page.
    • If you do not know the web address for your SiteWorx login page, either refer to your Welcome Email, or contact our 24/7 support team.
  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.
  6. 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.
  7. Within the Value column, update the value of each specific secure and unsecure URL to the intended URL.
  8. 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
  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 your Client Portal.

Ready to get started?

Get the fastest, most secure WordPress.org hosting on the market.

Additional resources

What is managed WordPress hosting? →

Get details and decide if managed WordPress hosting is right for you.

Must-have web development plugins to create WordPress websites at scale →

Explore the best web development plugins to enhance functionality, improve performance, and streamline your WordPress site.

A complete guide to WordPress shortcodes →

Shortcodes make life easier. Learn how to get started!