Knowledgebase

How to move Magento to another directory

In this article we will show you how to change the Magento installation directory so that your Magento store can work from another location.

Let's assume that your Magento works at www.yourdomain.com/magento and you want it to work directly at www.yourdomain.com. This would mean that your Magento is installed in /home/user/public_html/magento and it needs to go one directory up to /home/user/public_html.

The first thing you need to do is update your Magento Unsecure Base URL and Secure Base URL to match the new directory structure you will set in a minute. Log in to your Magento admin panel and go to System > Configuration > Web. In the Unsecure section change your Base URL from:

http://yourdomain.com/magento/

to

http://yourdomain.com/

Do the same for the Base URL setting in the Secure section and click Save Config to save the changes.

Now you need to copy/move the files from /home/user/public_html/magento to /home/user/public_html. The easiest way to do this is with your favorite FTP client (e.g. FileZilla). Make sure you copy/move all files and directories to the new location.

The last thing to do is delete the cache. Using your FTP client simply delete these two folders:

/home/user/public_html/var/cache

/home/user/public_html/var/session

You can now visit your Magento store at the new location.

Was this answer helpful?

 Print this Article

Also Read