qoogio Posted June 10, 2014 Share Posted June 10, 2014 Hi there,I have set up multi-store in Prestashop 1.6.0.6 and it works fine except for one detail, let me explain:I have shop 1:http://www.shop1.comShop 2:http://www.shop2.comIf you go to http://shop1.com, it redirected to www.shop1.com (no issue) and if go to http://www.shop2.com then everything works ok. However if you go to http://shop2.com (without www) then you get redirected to http://www.shop1.comThat's obviously a big problem as it is likely some visitors will omit the www. I parked the domain shop2.com on top of shop1.com using "Park domain" feature and shop1 is under root. My .htaccess file is this <IfModule mod_rewrite.c><IfModule mod_env.c>SetEnv HTTP_MOD_REWRITE On</IfModule> RewriteEngine onRewriteCond %{HTTP_HOST} ^www.shop1.com$RewriteRule . - [E=REWRITEBASE:/]RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] I have tried the below solution suggested by someone in one of the thread but it didn't work out and give 404 error on other pages, home page is fine. " try this: add this to the top of your .htaccess file..ensures www<IfModule mod_rewrite.c>RewriteEngine OnRewriteCond %{HTTP_HOST} !^www\.RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]</IfModule> " Does anyone able to help solve my problem? Very much appreciated your help. I have been spending hours to work this out but without luck. I am not technical guys Thanks in advance Link to comment Share on other sites More sharing options...
qoogio Posted June 13, 2014 Author Share Posted June 13, 2014 Anyone know how to do this ? Link to comment Share on other sites More sharing options...
tolaola Posted September 1, 2014 Share Posted September 1, 2014 I have the same problem. Hope that we find the solution. Did you tried to set the domain address in multisection without www? Link to comment Share on other sites More sharing options...
sygram Posted September 8, 2014 Share Posted September 8, 2014 Same issue here. Aparently the issue is not with .htaccess . I have added an index.html and tried http://shop2.com/index.html . The file is returned fine. So the issue must be in the prestashop code. Link to comment Share on other sites More sharing options...
wakabayashi Posted September 8, 2014 Share Posted September 8, 2014 Oh I am happy to found this thread. I thought I set up something wrong with domain. I have the same problem. Main Shop works perfectly with and without www. But Shop 2 only works with www. Link to comment Share on other sites More sharing options...
AlexMooren Posted September 9, 2014 Share Posted September 9, 2014 I have the issue and than whitout the www. if i enter just myshop2.com i get to the right shop. but if i add www or http it takes me back to the main store Link to comment Share on other sites More sharing options...
wakabayashi Posted September 9, 2014 Share Posted September 9, 2014 I think this is very logical. You probably set up your second store like that: http://myshop2.com We did it like: http://www.myshop2.com Link to comment Share on other sites More sharing options...
AlexMooren Posted September 9, 2014 Share Posted September 9, 2014 I have the same settings but it is not working More ideas? Link to comment Share on other sites More sharing options...
TiaNex Shopping Posted September 9, 2014 Share Posted September 9, 2014 (edited) <VirtualHost *:80> ServerAdmin webmaster@nfdexcom DocumentRoot "/var/www/html/xxxx.com" ServerName xxxx.com ServerAlias www.xxxx.com RewriteEngine on RewriteCond %{HTTP_HOST} ^xxxx\.com RewriteRule ^/(.*)$ http://www.xxxx.com/$1 [NC,R=301] ErrorLog "/var/log/httpd/xxxx.com-error.log" CustomLog "/var/log/httpd/xxxx.com-access.log" common </VirtualHost> hi,this is one VirtualHost in vhost.conf ,you can try it, Edited September 9, 2014 by NFDex (see edit history) Link to comment Share on other sites More sharing options...
Chris2013 Posted September 9, 2014 Share Posted September 9, 2014 (edited) I guess you could try this ( I don't profess to know much, if anything about .htaccess files) RewriteEngine On RewriteCond %{HTTP_HOST} ^shop1\.com RewriteRule (.*) http://www.shop1.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} ^shop2\.com RewriteRule (.*) http://www.shop2.com/$1 [R=301,L] Edited September 9, 2014 by Chris2013 (see edit history) Link to comment Share on other sites More sharing options...
sygram Posted September 9, 2014 Share Posted September 9, 2014 Hi to all, thanks for your replies. Actually i added these 2 lines in my .htaccess as suggested above : RewriteCond %{HTTP_HOST} !^www\.RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] and it worked 2 Link to comment Share on other sites More sharing options...
wakabayashi Posted September 9, 2014 Share Posted September 9, 2014 I tried both your .htaccess codes, but both don't work for me properly... They work if I go like this: shop2.com/site-1 -> http://www.shop2.com/site-1 -> correct shop2.com/ -> http://www.shop1.com -> not correct So the problem is that main url doesn't work. I checked also this: shop2.com/index.php -> http://www.shop2.com -> correct Any idea? Link to comment Share on other sites More sharing options...
sygram Posted September 9, 2014 Share Posted September 9, 2014 If i am i correct the above rules redirect everything that is not www. i.e. shop1.com to www.shop1.com and shop2.com to www.shop2.com . I added the line to the top of the .htaccess file, right after : <IfModule mod_rewrite.c><IfModule mod_env.c>SetEnv HTTP_MOD_REWRITE On</IfModule>RewriteEngine onRewriteCond %{HTTP_HOST} !^www\.RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] Link to comment Share on other sites More sharing options...
El Patron Posted September 9, 2014 Share Posted September 9, 2014 either way you go, to www or to non-www using .htaccess redirects: make sure to match that exact url (www or no www) in back office-->preferences-->seo & urls (domain and ssl domain names). 2 Link to comment Share on other sites More sharing options...
tolaola Posted September 17, 2014 Share Posted September 17, 2014 I had the same problem but now thanks to El Patron problem is solved. I've change everything under the code RewriteEngine on. I had to remove the earlier code and its work. My code in .htacces is: RewriteEngine onRewriteCond %{HTTP_HOST} !^www\.RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 1 Link to comment Share on other sites More sharing options...
Ganesh Hipparkar Posted December 2, 2014 Share Posted December 2, 2014 Hi to all, thanks for your replies. Actually i added these 2 lines in my .htaccess as suggested above : RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] and it worked Thanks very much Sygram Link to comment Share on other sites More sharing options...
El Patron Posted December 2, 2014 Share Posted December 2, 2014 usage note: ps can get 'very' confused and create issues with items in cart being lost. so if you use non-www to www in preferences-->seo & urls-->scroll down make sure that shop and ssl domain has the www. (this needs to be done if also if you do the revers, www to non-www) 1 Link to comment Share on other sites More sharing options...
Recommended Posts