How to change www.domain.com/ecommerce base URL to www.domain.com

In my cpanel folder structure is like public_html/ecommerce .

When I am updating www.domain.com in baseurl and removing ecommerce from base url site is not working even after clearing cache and session from backend and not able to login to the site.

Can any one please help me on this I am new to magento?

  • make sure you have web root pointed correctly and check if htaccess has no extra rewrites to ecommerce
    – MagenX
    Commented Mar 11, 2016 at 18:49

1 Answer 1


Please check if you have web root pointed correctly to your domain and check if .htaccess has no extra rewrites.

After doing above setting properly. Change your base_url. You can do it using any of the following method.

Method 1: Magento Admin Panel

  1. Log in to your Magento Admin Panel.
  2. On the upper right, click System > Configuration.
  3. From the menu on the left, under the General list, click Web
  4. Open the Unsecure and Secure dropdowns, locate the base URL line, and replace this with the new URL.
  5. Clear the Magento cache and your browser's cache. The site should now load properly.

Method 2: PhpMyAdmin

  1. Log in to your Cpanel account.
  2. Open PhpMyadmin.
  3. 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 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. 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.
  6. Within the Value column, update the value of each specific secure and unsecure URL to the intended URL.
  7. Flush the Magento cache, and the site should load with the set base URLs properly now.

Method 3: Command line

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

  1. Use SSH to log in to the server hosting the Magento installation's database.
  2. Enter the following command, where $database_user is the database user and $database_name is the database:

mysql -u $database_user -p $database_name

Enter your password when prompted. 3. Access their database using the following command, where database is the database name.

use database

  1. Run the following command:

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

  1. This will display the current base_urls set in Magento.
  2. 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';

For more details go to this link.

  • if you read his question - he can change base url.
    – MagenX
    Commented Mar 11, 2016 at 18:46
  • @MagenX Yes . Thanks. updated my answer. :-) Commented Mar 11, 2016 at 19:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.