How To: Move Magento from Subdomain to Main Domain


Moving Magento from your Subdomain to your Main Domain (and vice versa) is very seamless and easy.

All you need to do is to follow the following steps:-

  1. Go to Magento Admin --> System --> Configurations --> Web --> Unsecure URL & Secure URL. Change both the Secure URL and Unsecure URL to the domain that you are going to be moved to.  Be sure to include the "/" at the end of the domain name.
  2. Go to your File Manager and click "Select All". Click "Move" and key in "/public_html" to move it to the main domain's directory.
  3. You may need to clear the caches at "var/cache" and "var/session" after you have moved all files over.


You can also perform the Step 1 above through the database instead of going through the Magento admin:-

  1. Go to phpMyAdmin. Find and click your Magento database from the list of the left bar. 
  2. Scroll down and look for core_config_data. Click "Browse" (the first button at the side). 
  3. Find the path "web/unsecure/base_url" and "web/secure/base_url". 
  4. Click on the "Pencil" icon of both of the path above and edit the URLs accordingly (one path at a time)
  5. Click "Go" after the URLs have been edited. 


Note:-

  • It is advisable to backup your files and databases before performing the above stated steps.

Was this answer helpful?

 Print this Article

Also Read

How To: Upgrade Magento to the Latest Version

Note: It is always recommended to perform multiple form of backups before you perform any...

How To: Create A PHP Info File

A PHP info file displays information about your PHP installation that can be useful to...

Magento Security Patches

From time to time Magento will release patches for security vulnerabilities or simply standard...

How To: Install Magento using Installatron Script Installer

There are a few easy steps that you will need to take to install Magento using Installatron...

How To: Add Attributes to Product Grid in Category

Introduction Here we will show how to add your more attributes to the category view product list...