SK01 Posted September 7, 2010 Share Posted September 7, 2010 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 folder2. 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 More sharing options...
Patric Posted September 7, 2010 Share Posted September 7, 2010 That should be enough.Do not forget to switch your shop to maintenance mode while you do it. Link to comment Share on other sites More sharing options...
SK01 Posted September 7, 2010 Author Share Posted September 7, 2010 Okay. Thanks Link to comment Share on other sites More sharing options...
aliaspt Posted October 8, 2010 Share Posted October 8, 2010 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 More sharing options...
rocky Posted October 8, 2010 Share Posted October 8, 2010 Move the contents of the "shop" folder to the root directory. Make a backup of your files first if you are worried about messing something up. Link to comment Share on other sites More sharing options...
aliaspt Posted October 8, 2010 Share Posted October 8, 2010 Going to sound totally stupid... but, can I leave the shop folder with its contents where it is? Is the root directory - public_html? Thank you for patience! Link to comment Share on other sites More sharing options...
rocky Posted October 8, 2010 Share Posted October 8, 2010 Yes, it is public_html that is the root directory. I suppose you could just copy the contents of the folder instead of moving it if you want to be sure you don't lose anything, though it takes longer to copy than to move. Link to comment Share on other sites More sharing options...
aliaspt Posted October 8, 2010 Share Posted October 8, 2010 Will try that tomorrow. May bug you again. Thanks! Link to comment Share on other sites More sharing options...
aliaspt Posted October 8, 2010 Share Posted October 8, 2010 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 More sharing options...
rocky Posted October 8, 2010 Share Posted October 8, 2010 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 More sharing options...
aliaspt Posted October 8, 2010 Share Posted October 8, 2010 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 More sharing options...
aliaspt Posted October 8, 2010 Share Posted October 8, 2010 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 More sharing options...
aliaspt Posted October 8, 2010 Share Posted October 8, 2010 I just tried removing /shop/ from the directory and it opens products in the root, too! Is that because I kept the original folder? Still nervous to delete it from the server! Link to comment Share on other sites More sharing options...
rocky Posted October 8, 2010 Share Posted October 8, 2010 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 More sharing options...
aliaspt Posted October 8, 2010 Share Posted October 8, 2010 Did and did. Nothing changed in the htaccess. "Shop" is still there. Sigh... Link to comment Share on other sites More sharing options...
rocky Posted October 8, 2010 Share Posted October 8, 2010 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 More sharing options...
aliaspt Posted October 8, 2010 Share Posted October 8, 2010 Alright, did everything you suggested and removing /shop/ manually was the ONLY thing that worked for me. THANK YOU!!! Link to comment Share on other sites More sharing options...
aliaspt Posted October 8, 2010 Share Posted October 8, 2010 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 More sharing options...
aliaspt Posted October 9, 2010 Share Posted October 9, 2010 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 More sharing options...
rocky Posted October 9, 2010 Share Posted October 9, 2010 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 More sharing options...
aliaspt Posted October 9, 2010 Share Posted October 9, 2010 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 More sharing options...
aliaspt Posted October 9, 2010 Share Posted October 9, 2010 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now