cancel
Showing results for 
Search instead for 
Did you mean: 

Move site from /magento2/ to root of url ?

Move site from /magento2/ to root of url ?

I have installed my magento 2.21 on the webserver in www.mydomain.com/magento2/

 

Now I wish to have the store in www.mydomain.com/

 

I tried to change the url in the menu store/web/baseurl and press 'save'

 

then i i get a error on loading the page and can't get into the admin page. In www.mydomain.com/magento2/ i can see the store but with no css. 

 

HOW DO I get my store from the subfolder to the mainfolder ? 

What am I doing wrong?

8 REPLIES 8

Re: Move site from /magento2/ to root of url ?

Have you moved the magento codebase to not be in a subfolder? What's the document root in your webserver configuration? i.e. nginx or apache configuration. 

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Move site from /magento2/ to root of url ?

I have not moved anything..

Just made the change in the admin page. 

 

in the installation guide it is recommended to install in a subdirectory called www.mydomain.com/magento2

Of course I want it to be visible on www.mydomain.com/

 

should I just copy the index.php and the .htaccess file ? 

 

 

Re: Move site from /magento2/ to root of url

Can you share the link to the installation guide that you are following?

I do think it’s fine keeping it in the magento2 folder but only if you
update the web server configuration to let it know. If you previously had
magento2 in the URL it means the web server was configured to have the
parent directory as the document root.

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Move site from /magento2/ to root of url

is this perhaps the way to do it ?


DOT = .
shopping-cart-migration(DOT)com/blog/42-magento/22243-how-to-move-magento-from-subdirectory-to-root-directory

Re: Move site from /magento2/ to root of url

Yeah, you have a few options:

 

  1. Move magento out of subdirectory to parent directory
  2. Change web server configuration so that the document root includes the subdirectory
  3. Create symlinks in the parent directory to the subdirectory for key files like in that article. 
----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!

Re: Move site from /magento2/ to root of url

In my terminal I can't type Sudo commands.. How do I do the last part of the guide?

Re: Move site from /magento2/ to root of url

@Tom Robertshaw  Do you know how I get the

"sudo ln /s  js ../"
"sudo ln /s  skin ../" 

"sudo ln /s  media ../"

 

code on a apache server ?

 

how do I symlink? 

Re: Move site from /magento2/ to root of url

If you don't have the level of access required, then maybe you can send a support request to your host to help with the configuration?

----
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!