Vote to Improve PrestaShop

PrestaShop Forum: Build a free online shop. Count on the Community!

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum: Build a free online shop. Count on the Community!

Jump to content

 
Photo

[solved] Move prestashop from subfolder to root


  • Please log in to reply
30 replies to this topic
midrik

    PrestaShop Newbie

  • Members
  • Pip
  • 4 posts

Posted 05 May 2009 - 11:54 PM

Hello

Im new to PS and am working on my first installation and setup using the latest stable version. I installed PS in a subfolder (www.domain.com/prestashop) but now I want to move it to the root folder so it will be www.domain.com

How do I do this?

Is there anything I can mess up in the process?

Some config file to edit?


Thanks
-midrik

Psychodays

    PrestaShop Apprentice

  • Members
  • PipPip
  • 179 posts

Posted 06 May 2009 - 09:04 AM

one sure fire method is to backup your DB and product images FIRST<<
then move your entire folder up a level. See if it's working. If not, move it back again. Do another install of your prestashop, upload your image files and insert the DB entries.
Marre des Conseils Contradictoires? Apprenez à Référencer Comme Un PRO sur :
Formation Referencement Ecommerce
Fermoir porte monnaie

MeenaInc

    PrestaShop Apprentice

  • Members
  • PipPip
  • 25 posts

Posted 11 May 2009 - 03:46 PM

Also, once you make the move you need to go into your Admin back office and change the location of the install and leave that box blank. Once in the BO hit your PREFERENCES tab and make the necessary change.

michaeld

    PrestaShop Newbie

  • Members
  • Pip
  • 2 posts

Posted 12 May 2009 - 02:28 PM

why not leave in the sub?

just edit your .htaccess file in the root dir and put this in it:
(you need to replace prestashop by your own subdir and mysite.com by your own domainname obviously)
# Copy and paste the following code into the .htaccess file# in the public_html folder of your hosting account# make the changes to the file according to the instructions.# Do not change this line - RewriteEngine onRewriteEngine on# Change yourdomain.com to be your main domain.RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$# Change 'subfolder' to be the folder you will use for your main domain.RewriteCond %{REQUEST_URI} !^/prestashop/# Don't change this line.RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d# Change 'subfolder' to be the folder you will use for your main domain.RewriteRule ^(.*)$ /prestashop/$1# Change yourdomain.com to be your main domain again.# Change 'subfolder' to be the folder you will use for your main domain# followed by / then the main file for your site, index.php, index.html, etc.RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$RewriteRule ^(/)?$ prestashop/index.php [L]


szejia

    PrestaShop Newbie

  • Members
  • Pip
  • 5 posts

Posted 02 March 2010 - 04:15 AM

Thanks michaeld! I needed this solution badly!

ourwebdesigner

    PrestaShop Newbie

  • Members
  • Pip
  • 6 posts

Posted 19 December 2010 - 12:59 PM

Michaeld - sorry to just in like this - i have a question on this topic.

I used your htaccess script and it works great thanks for sharing.

Is there anyway to not have the address bar show the /folder when search has been done. At the moment my shop is in a folder called /shop. When i type mywebsite.com into the address bar. It shows mywebsite.com/shop/index.php also happens when typing www.mywedsite.com
The other thing is canonical where the url always shows either www.mywebsite.com or mywebsite.com

I think this solution would be helpful for everyone along with your method above.

jmase

    PrestaShop Newbie

  • Members
  • Pip
  • 24 posts

Posted 02 February 2011 - 09:42 AM

ignore me /noob

Moohstore

    PrestaShop Newbie

  • Members
  • Pip
  • 20 posts

Posted 05 February 2011 - 11:51 PM

Thank you good tutorial :)

Perezan

    PrestaShop Newbie

  • Members
  • Pip
  • 2 posts

Posted 01 March 2011 - 03:21 PM

why not leave in the sub?

just edit your .htaccess file in the root dir and put this in it:
(you need to replace prestashop by your own subdir and mysite.com by your own domainname obviously)

# Copy and paste the following code into the .htaccess file# in the public_html folder of your hosting account# make the changes to the file according to the instructions.# Do not change this line - RewriteEngine onRewriteEngine on# Change yourdomain.com to be your main domain.RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$# Change 'subfolder' to be the folder you will use for your main domain.RewriteCond %{REQUEST_URI} !^/prestashop/# Don't change this line.RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d# Change 'subfolder' to be the folder you will use for your main domain.RewriteRule ^(.*)$ /prestashop/$1# Change yourdomain.com to be your main domain again.# Change 'subfolder' to be the folder you will use for your main domain# followed by / then the main file for your site, index.php, index.html, etc.RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$RewriteRule ^(/)?$ prestashop/index.php [L]



This worked perfectly thank you

Troy

    PrestaShop Apprentice

  • Members
  • PipPip
  • 281 posts

Posted 16 March 2011 - 07:55 PM

Thanks. That tutorial works like a charm :)

salko

    PrestaShop Apprentice

  • Members
  • PipPip
  • 113 posts

Posted 22 March 2011 - 09:13 AM

why not leave in the sub?

just edit your .htaccess file in the root dir and put this in it:
(you need to replace prestashop by your own subdir and mysite.com by your own domainname obviously)

# Copy and paste the following code into the .htaccess file# in the public_html folder of your hosting account# make the changes to the file according to the instructions.# Do not change this line - RewriteEngine onRewriteEngine on# Change yourdomain.com to be your main domain.RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$# Change 'subfolder' to be the folder you will use for your main domain.RewriteCond %{REQUEST_URI} !^/prestashop/# Don't change this line.RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d# Change 'subfolder' to be the folder you will use for your main domain.RewriteRule ^(.*)$ /prestashop/$1# Change yourdomain.com to be your main domain again.# Change 'subfolder' to be the folder you will use for your main domain# followed by / then the main file for your site, index.php, index.html, etc.RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$RewriteRule ^(/)?$ prestashop/index.php [L]



I also have my prestashop in /root/prestashop dir and I don't want to have my web address www.maindomain.com/prestashop, but only www.maindomain.com. And I would like to keep prestashop dir (don't want to move all content to root dir). Will above solution work with v1.4.0.17? Which are all the files needed to be in root folder (beside .htaccess)? Thank you!
www.orhidea.si - Tropical orchid shop

phunter121

    PrestaShop Apprentice

  • Members
  • PipPip
  • 88 posts

Posted 03 June 2011 - 09:49 AM

I might be missing the point here (as I am no expert). Is there any reason this would not work:

1. Have your live PS files in a sub directory (e.g. /version_1 ). On your host, set the websites home (or destination) directory to the sub directory. Then in PS preferences-->URL setup, set the 'PS directory' to "/" (thus ensuring the sub directory is not displayed in the URL on your browser).

2. If you have a development version, place this in a sub folder within the live folder (i.e. /version_1/version_2 ). In the development PS preferences-->URL setup, set the 'PS directory' to "/version_2/".

3. When your new version is ready, just:
- copy directory "/version_2" up a level
- change the PS preferences-->URL setup, set the 'PS directory' to "/"
- on your host, change the websites home directory to /version_2

4. If you have any problems with your new site, you can just change the website home directory back to /version_1 and you are back up and running.
Canine Concepts - dog crates dog cages dog whistles dog kennels dog beds and dog boots

geoffrey27

    PrestaShop Apprentice

  • Members
  • PipPip
  • 28 posts

Posted 14 June 2011 - 06:28 PM

Merci pour le post :):):)
Fonctionne tres bien

gavsmales

    PrestaShop Newbie

  • Members
  • Pip
  • 8 posts

Posted 16 June 2011 - 04:07 PM

Hi, this is my first time using PS and i am building my online store, what i want to do is have a home screen with a click to enter button at the main domain - www.stickerwerkz.com and have my prestashop at www.stickerwerkz.com/shop

The shop is currently the main domain, as soon as you go to the site. How do i do this in simple terms please!

Thanks for any help :)

eddieuk

    PrestaShop Apprentice

  • Members
  • PipPip
  • 127 posts

Posted 28 August 2011 - 08:52 PM

why not leave in the sub?<br/><br/>just edit your .htaccess file in the root dir and put this in it:<br/>(you need to replace prestashop by your own subdir and mysite.com by your own domainname obviously)<br/>

<br/># Copy and paste the following code into the .htaccess file<br/># in the public_html folder of your hosting account<br/># make the changes to the file according to the instructions.<br/><br/># Do not change this line - RewriteEngine on<br/>RewriteEngine on<br/><br/># Change yourdomain.com to be your main domain.<br/>RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$<br/><br/># Change 'subfolder' to be the folder you will use for your main domain.<br/>RewriteCond %{REQUEST_URI} !^/prestashop/<br/><br/># Don't change this line.<br/>RewriteCond %{REQUEST_FILENAME} !-f<br/>RewriteCond %{REQUEST_FILENAME} !-d<br/><br/># Change 'subfolder' to be the folder you will use for your main domain.<br/>RewriteRule ^(.*)$ /prestashop/$1<br/><br/># Change yourdomain.com to be your main domain again.<br/># Change 'subfolder' to be the folder you will use for your main domain<br/># followed by / then the main file for your site, index.php, index.html, etc.<br/>RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$<br/>RewriteRule ^(/)?$ prestashop/index.php [L]<br/><br/><br/>


I tried this solution (thanks for posting) but now my database isn't working. No photos from it appear and the product pages don't work.

Any ideas?

>>>
Update:
WHen I turn URL re-write off the database works fine from subfolder location.

eddieuk

    PrestaShop Apprentice

  • Members
  • PipPip
  • 127 posts

Posted 28 August 2011 - 09:30 PM

I now think I've just got a problem with re-writing in general... :-|

eddieuk

    PrestaShop Apprentice

  • Members
  • PipPip
  • 127 posts

Posted 28 August 2011 - 10:01 PM

I'm a genius. Made a backup of the original re-writing script Presta generated in my old .htaccess file. Used that then updated the file names to include new sub-directory. Now it's working.

Has to be said the .htaccess auto-generate in the back office did not work. Very annoying. If I had not have made that backup I would not have been able to fix this.

eddieuk

    PrestaShop Apprentice

  • Members
  • PipPip
  • 127 posts

Posted 29 August 2011 - 03:35 AM

Ah, now I cant even create a fresh install. Updating Prestashop is a complete nightmare. The updated version in my sub-folder works but very slowly when loading categories. So I need to create a new version but the databases wont even connect now when trying a fresh install. Starting to hate prestashop.

bigbear1398

    PrestaShop Newbie

  • Members
  • Pip
  • 2 posts

Posted 05 September 2011 - 12:02 PM

why not leave in the sub?
just edit your .htaccess file in the root dir and put this in it:
(you need to replace prestashop by your own subdir and mysite.com by your own domainname obviously)

# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.
# Do not change this line - RewriteEngine on
RewriteEngine on
# Change yourdomain.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
# Change 'subfolder' to be the folder you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/prestashop/
# Don't change this line.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subfolder' to be the folder you will use for your main domain.
RewriteRule ^(.*)$ /prestashop/$1
# Change yourdomain.com to be your main domain again.
# Change 'subfolder' to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteRule ^(/)?$ prestashop/index.php [L]


I might be missing the point here (as I am no expert). Is there any reason this would not work:
1. Have your live PS files in a sub directory (e.g. /version_1 ). On your host, set the websites home (or destination) directory to the sub directory. Then in PS preferences-->URL setup, set the 'PS directory' to "/" (thus ensuring the sub directory is not displayed in the URL on your browser).
2. If you have a development version, place this in a sub folder within the live folder (i.e. /version_1/version_2 ). In the development PS preferences-->URL setup, set the 'PS directory' to "/version_2/".
3. When your new version is ready, just:
- copy directory "/version_2" up a level
- change the PS preferences-->URL setup, set the 'PS directory' to "/"
- on your host, change the websites home directory to /version_2
4. If you have any problems with your new site, you can just change the website home directory back to /version_1 and you are back up and running.


Combine 2 solution above on 1.4.2.5 + siteground hosting redirect from root too subdirectory and hide subdirectory is work great.

I edit only .htaccess on web hosting root (/public_html/) and let's presta back office automatic generate .htaccess with URL friendly on /public_html/presta1425

Any questions are welcome (Thai/English lang.)

bellini13

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 3951 posts

Posted 07 September 2011 - 01:30 PM

couldn't you use subdomains to accomplish this as well?

so www.mydomain.com/shop would redirect to shop.mydomain.com?
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users