Jump to content

[SOLVED] Move prestashop to my root folder.. how?


Recommended Posts

Hi, I want to move my store from a subdirectory ( /store ) to the root folder.

What do I need to do? I dont want to lose any data and here is what I think i need to do:


1. Copy the whole folder, and move it into the root folder
2. Change line 3 in config/settings.inc:

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



to

define('__PS_BASE_URI__', '/');



Is this correct? And do I need to do anything more?

Many thanks!

Link to comment
Share on other sites

  • 1 month later...

By "copying the whole folder", do you mean all contents of the folder? Or I need to move the folder itself? What will happen if I leave the /shop/ folder where it is but copy and paste it in the root folder without "moving" it? Very nervous to lose all the work.

Link to comment
Share on other sites

So, I moved everything to the root directory. The home page opens but for other pages I get 404 error. I suspect it's because of .htaccess file. What am I supposed to do to make it work? Copy and paste contents of the old one?
This is what it says

# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php


I changed permissions to 666 (writing)
Do I need to change permissions on other files like I did during my first PrestaShop installation? It looks like they are different from the ones I have on folders in the /shop/.
Thanks!

Link to comment
Share on other sites

You need to copy the code from the old .htaccess file, enable friendly URL if you haven't already, then go to Tools > Generators then click the "Generate .htaccess file" button, then paste the old code at the top of the .htaccess file PrestaShop created.

Link to comment
Share on other sites

OK, I obviously had the old htaccess file and it got copied/pasted together with other contents of the /shop/ folder. Now, it opens product pages but they are in /shop/ directory. What do I do to make them open in the root directory? Thank you!

Link to comment
Share on other sites

This is the htaccess file I have right now:

# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

# URL rewriting module activation
RewriteEngine on

# URL rewriting rules
RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /shop/img/p/$1-$2$3.jpg [L,E]
RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /shop/img/p/$1-$2.jpg [L,E]
RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /shop/img/c/$1$2.jpg [L,E]
RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /shop/product.php?id_product=$3&isolang;=$1$5 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /shop/product.php?id_product=$2&isolang;=$1$4 [L,E]
RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /shop/category.php?id_category=$2&isolang;=$1 [QSA,L,E]
RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /shop/product.php?id_product=$2$4 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /shop/product.php?id_product=$1$3 [L,E]
RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /shop/category.php?id_category=$1 [QSA,L,E]
RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /shop/cms.php?id_cms=$1 [QSA,L,E]
RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /shop/supplier.php?id_supplier=$1$3 [QSA,L,E]
RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /shop/manufacturer.php?id_manufacturer=$1$3 [QSA,L,E]
RewriteRule ^lang-([a-z]{2})/(.*)$ /shop/$2?isolang=$1 [QSA,L,E]

# Catch 404 errors
ErrorDocument 404 /shop/404.php

Link to comment
Share on other sites

If you've moved the files to the root directory, you need to go to the Preferences tab and change the "PS directory" from /shop/ to / or manually change the PS_BASE_URI in config/settings.inc.php. Then regenerate your .htaccess file so that /shop/ is removed from the .htaccess file.

Link to comment
Share on other sites

Check to make sure that config/settings.inc.php has the following line:

define('__PS_BASE_URI__', '/');



If it does, then regenerating the .htaccess file should change /shop/ to / in the .htaccess file. If not, then I guess the .htaccess file doesn't have chmod 666 permissions. If you still can't get it to work, you will have to manually change all the /shop/ to / in your .htaccess file.

Link to comment
Share on other sites

Ugh, I just deleted the /shop/ folder and tried to place an order. When I choose payment method, it opens a blank page - both for credit card and PayPal. What did I break? It seems to be related to modules only (unless I haven't noticed other things). If I click on advertising module, it says such page doesn't exist. If I click on Wishlist, it opens a blank page.

Link to comment
Share on other sites

To make it even better, all image links are not valid now. I am ready to move the shop folder back! Would it be better to leave the store in the subfolder but create a reference in htaccess file? I read here that you can do that instead of moving subfolder contents to the root directory.
Please help!!! Just when I thought I was ready to launch... it is all a big mess now.

Link to comment
Share on other sites

Is it all the images or just some? If it is all, then it is a .htaccess issue. If it is only some, then your FTP client probably only copied some of the images and not all of them.

I'm wondering whether this has something to do with the fact that you can't regenerate your .htaccess file? I guess you will have to move the files back to the shop directory. It is strange, since I've never had any problem moving files to the root directory before.

Link to comment
Share on other sites

All images were missing. Yeah, I don't think that file was doing what it was supposed to. I just moved all files back to shop directory. I'll look for that code that I need to paste in the htaccess file so that it redirects to the main root. Thanks a bunch for trying to help!

Link to comment
Share on other sites

Guys, save yourself time and frustration. Follow instructions of michaeld here
http://www.prestashop.com/forums/viewthread/18393/help_installation___upgrade/move_prestashop_from_subfolder_to_root/
Works for me so far. I'll report back if I find any problems. I also added /$1 in the last line of the code
RewriteRule ^(/)?$ prestashop/index.php/$1 [L] after reading here http://www.concrete5.org/community/forums/customizing_c5/domain_root_-_cms_link_problem/

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...