Jump to content
drroot

[SOLVED] How to move PS installation from a subfolder to the root directory?

Recommended Posts

Currently I installed PS under public_html/test,

but I want to move it to public_html

 

Any idea how to do this?

Share this post


Link to post
Share on other sites

Basically, you need to copy the files from /public_html/test and paste them directly in the root public_html folder. Then edit the file settings.inc.php (public_html/config/settings.inc.php). Change the line:

 

define('__PS_BASE_URI__', '/test/');

 

into:

 

define('__PS_BASE_URI__', '/');

 

Then log in to the back office using the root URL address, go to the Preferences tab>SEO & URLs sub-tab and change the path to the shop in the field for PS directory; in this case it's the root (e.g. /). You don't have to change any database names or prefixes in the config file since you're not moving to a different server, and I assume you'll be using the same database. You'll also need to regenerate the robots.txt file and the .htaccess file. You can do this from Tools tab>Generators sub-tab.

 

To remove the old shop just delete the contents of /public_html/test. Before you start the transfer you may consider disabling the shop (if it's in production mode at all), although this whole thing shouldn't take more than a few minutes.

 

Hope this helps.

  • Like 1

Share this post


Link to post
Share on other sites

I tried to establish a test site in a subfolder but have trouble connecting the database and it will not let be log into the back office even though i changes the url. Any help would be appreciated

Share this post


Link to post
Share on other sites

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More