How to Change Magento Base URL Via phpMyAdmin ?


Magento is a free and powerful open-source content management system (CMS) using which websites can be created for free for different purposes. It is coming as a script in Softaculous given by Silicon House in Linux reseller hosting. In this article, you will learn about changing magento base URL via phpMyAdmin.


To change the magento base URL, you can follow the below procedure :

  1. Login to cPanel of the website
  2. Access to phpMyAdmin under Databases
  3. Expand the database associated with the Magento installation and select the “core_config_data” table
  4. Sort table by path column and find the following rows for your unsecure section, they should look like the following:

Columns

PATH VALUE
web/unsecure/base_url http://www.example.com/
web/unsecure/base_link_url {{unsecure_base_url}}
web/unsecure/base_skin_url {{unsecure_base_url}}skin/
web/unsecure/base_media_url {{unsecure_base_url}}media/
web/unsecure/base_js_url {{unsecure_base_url}}js/

  1. Replace http://www.example.com/ with your appropriate domain url (trailing slash necessary) and if you’ve installed in a subfolder append it with a / after it. For eg : http://www.example.com/test/
  2. Then Find the following rows for your secure section, they should look like the following:

Columns

PATH VALUE
web/secure/base_url https://www.example.com/
web/secure/base_link_url {{secure_base_url}}
web/secure/base_skin_url {{secure_base_url}}skin/
web/secure/base_media_url {{secure_base_url}}media/
web/secure/base_js_url {{secure_base_url}}js/

  1. Replace https://www.example.com/ with your appropriate domain url (trailing slash necessary) and if you’ve installed in a subfolder append it with a / after it. If you haven’t received your security certificate and enabled TLS/SSL yet, use http instead of https
  2. Clear contents from var/cache, var/session directories after changing base_urls

NOTE: If you have set your base_url correctly for web/unsecure/base_url and web/secure/base_url you do not have to do any changes in {{UNSECURE_BASE_URL}} and {{SECURE_BASE_URL}} macros in the rest of the entries.

You can also change Magento Base URL in magento backend panel. The below procedure gives you the procedure to change Magento base URL via Magento backend :

Magento 1

Configure the unsecure base URLs:

  1. In your Magento backend, go to System > Configuration
  2. On the left menu, under General section, click Web
  3. Expand Unsecure section. Enter the unsecure (http) Base URL for your store. Make sure to end the URL with a forward slash (“/”)
  4. If you don’t plan to use a secure base URL for the Admin(Optional), do the following:
    a. Expand Secure section
    b. Enter your unsecure (http) Base URL. The URL should be the same in both the Secure and Unsecure sections
  5. Click the Save Config button

Configure the secure base URLs:

If your domain has a valid security certificate, you can configure the URLs for either the frontend and Admin—or both—to run over a secure (https) channel.

  1. In your Magento backend, go to System > Configuration
  2. On the left menu, under General section, click Web
  3. Expand Secure section. Then, do the following:
  4. To use a secure (https) for the frontend, enter the Base URL, followed by a forward slash (“/”)
    If you want to run the entire storefront over a secure (https) channel, set Use Secure URLs in Frontend to Yes
    If you want to run the entire Admin over a secure (https) channel, set Use Secure URLs in Admin to Yes
  5. Click the Save Config button