[solved] Move prestashop from subfolder to root - Installing PrestaShop - PrestaShop

Jump to content

Photo

[solved] Move prestashop from subfolder to root

#1

Posted 05 May 2009 - 11:54 PM

midrik

    PrestaShop Newbie

  • Members
  • Pip
  • 4 Active Posts
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

#2

Posted 06 May 2009 - 09:04 AM

Psychodays

    PrestaShop Apprentice

  • Members
  • PipPip
  • 179 Active Posts
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

#3

Posted 11 May 2009 - 03:46 PM

MeenaInc

    PrestaShop Apprentice

  • Members
  • PipPip
  • 25 Active Posts
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.

#4

Posted 12 May 2009 - 02:28 PM

michaeld

    PrestaShop Newbie

  • Members
  • Pip
  • 2 Active Posts
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]


#5

Posted 02 March 2010 - 04:15 AM

szejia

    PrestaShop Newbie

  • Members
  • Pip
  • 5 Active Posts
Thanks michaeld! I needed this solution badly!

#6

Posted 19 December 2010 - 12:59 PM

ourwebdesigner

    PrestaShop Newbie

  • Members
  • Pip
  • 6 Active Posts
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.

#7

Posted 02 February 2011 - 09:42 AM

jmase

    PrestaShop Newbie

  • Members
  • Pip
  • 24 Active Posts
ignore me /noob

#8

Posted 05 February 2011 - 11:51 PM

Moohstore

    PrestaShop Newbie

  • Members
  • Pip
  • 20 Active Posts
Thank you good tutorial :)

#9

Posted 01 March 2011 - 03:21 PM

Perezan

    PrestaShop Newbie

  • Members
  • Pip
  • 2 Active Posts

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

#10

Posted 16 March 2011 - 07:55 PM

Troy

    PrestaShop Apprentice

  • Members
  • PipPip
  • 282 Active Posts
Thanks. That tutorial works like a charm :)

#11

Posted 22 March 2011 - 09:13 AM

salko

    PrestaShop Apprentice

  • Members
  • PipPip
  • 113 Active Posts

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

#12

Posted 03 June 2011 - 09:49 AM

phunter121

    PrestaShop Apprentice

  • Members
  • PipPip
  • 88 Active Posts
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

#13

Posted 14 June 2011 - 06:28 PM

geoffrey27

    PrestaShop Apprentice

  • Members
  • PipPip
  • 28 Active Posts
Merci pour le post :):):)
Fonctionne tres bien

#14

Posted 16 June 2011 - 04:07 PM

gavsmales

    PrestaShop Newbie

  • Members
  • Pip
  • 8 Active Posts
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 :)

#15

Posted 28 August 2011 - 08:52 PM

eddieuk

    PrestaShop Apprentice

  • Members
  • PipPip
  • 127 Active Posts

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.

#16

Posted 28 August 2011 - 09:30 PM

eddieuk

    PrestaShop Apprentice

  • Members
  • PipPip
  • 127 Active Posts
I now think I've just got a problem with re-writing in general... :-|

#17

Posted 28 August 2011 - 10:01 PM

eddieuk

    PrestaShop Apprentice

  • Members
  • PipPip
  • 127 Active Posts
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.

#18

Posted 29 August 2011 - 03:35 AM

eddieuk

    PrestaShop Apprentice

  • Members
  • PipPip
  • 127 Active Posts
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.

#19

Posted 05 September 2011 - 12:02 PM

bigbear1398

    PrestaShop Newbie

  • Members
  • Pip
  • 2 Active Posts

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.)

#20

Posted 07 September 2011 - 01:30 PM

bellini13

    PrestaShop Fanatic

  • Members
  • PipPipPipPip
  • 4596 Active Posts
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

Cookies help us deliver our services. By using our services, you agree to use our cookies.     Learn more