I have my Magento's file and folder structure inside a folder. I uploaded that folder to the www directory of my server. Now I am able to access my store with the URL myUrl.com/myMagentoFolder, where myUrl.comis the URL of my domain, and myMagentoFolderis the folder that I uploaded to wwww.

I need to be able to access my store with the URL myUrl.com, without /myMagentoFolder. I already created an .htaccess file and tried writing different directives but none of them works.

Any ideas on how to solve that? Any help is much appreciated.


add blow lines to your .htaccess in root directory

RewriteEngine On
RewriteRule ^/?myMagentoFolder/ http://www.myUrl.com/? [R=301,L]

Feel free for any query

| improve this answer | |
  • Thanks for your answer. I tried but again with no results. Now I access myUrl.com and while the URL doesn't change, no content is displayed. May I be missing something? – LeCodeur Mar 15 '17 at 9:32

You can either login to the backend and go and change the URL to the new one at

Configuration -> Web -> Unsecure Base URL and Secure Base URL.

Otherwise you need to access the database and look under the core_config_data table and web/unsecure/base_url and web/secure/base_url.

If you did not migrate the database or create a new one, you first need to make sure the Magento installation have access to it.

Look for the file named local.xml found under /app/etc/.

Edit the file and change USERNAME and PASSWORD inside the brackets for the database.

| improve this answer | |
  • I already did that. My problem is that I need that the url is only myUrl.com without the need of /myMagentoFolder. I need my server to look by default inside myMagentoFolder and take all the content from there but without adding myMagentoFolder. – LeCodeur Mar 15 '17 at 9:37
  • Any reason why it can't be in the root folder of your server? – André Mar 15 '17 at 9:39
  • It's just because I want it to be well organised and structured. – LeCodeur Mar 15 '17 at 9:40
  • Does the server run nginx or apache? – André Mar 15 '17 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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