FredActin Posted March 18, 2013 Share Posted March 18, 2013 (edited) Hi there, I have set up multi-store and it works fine except for one detail, let me explain: I have shop 1: http://www.shop-one.com Shop 2: http://www.shop-two.com If you go to http://www.shop-two.com then everything works ok. However if you go to http://shop-two.com (without www) then you get redirected to http://www.shop-one.com That's obviously a big problem as it is likely some visitors will omit the www. I have tried the other way around with the same effect: if I set up multi-store without www then it works fine with http://shop-two.com but not with http://www.shop-two.com Technical details: Prestashop 1.5.3.1 I parked the domain shop-two.com on top of shop-one.com using WHM "Park a domain" feature. Does anyone have any idea about what I'm missing? Thanks in advance Edited March 18, 2013 by FredActin (see edit history) Link to comment Share on other sites More sharing options...
El Patron Posted March 18, 2013 Share Posted March 18, 2013 (edited) try this: add this to the top of your .htaccess file..ensures www <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] </IfModule> Edited December 4, 2015 by El Patron removed free module..no longer supported (see edit history) 5 Link to comment Share on other sites More sharing options...
FredActin Posted March 18, 2013 Author Share Posted March 18, 2013 (edited) Hi Elpatron, This works just great! Many thanks! I'm just curious - is it the expected behaviour? (for the multi-shop to only work with http:// only or www?) Anyway my problem is [sOLVED] Edited March 18, 2013 by FredActin (see edit history) 2 Link to comment Share on other sites More sharing options...
El Patron Posted March 18, 2013 Share Posted March 18, 2013 Hi Elpatron, This works just great! Many thanks! I'm just curious - is it the expected behaviour? (for the multi-shop to only work with http:// only or www?) Anyway my problem is [sOLVED] with pleasure it's not really a multishop issue, ps will treat non-www and www as two sets of cookies... 1 Link to comment Share on other sites More sharing options...
FredActin Posted March 18, 2013 Author Share Posted March 18, 2013 Ah ok I see! Thanks again for taking the time to help, much appreciated 1 Link to comment Share on other sites More sharing options...
gustavo07 Posted April 10, 2013 Share Posted April 10, 2013 (edited) Hello, I put: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] </IfModule> if my site is www.mysite.com And if my site is mysite.com? Can you help me? Thanks in advance. Edited April 10, 2013 by gustavo07 (see edit history) Link to comment Share on other sites More sharing options...
sabio Posted February 15, 2014 Share Posted February 15, 2014 Hi, This gave me a loop on the default store. Regards Link to comment Share on other sites More sharing options...
El Patron Posted February 15, 2014 Share Posted February 15, 2014 Hi, This gave me a loop on the default store. Regards what did? what did you do? Link to comment Share on other sites More sharing options...
sabio Posted February 15, 2014 Share Posted February 15, 2014 @El Patron, Haha, sorry. Thanks for the reply. The mistake was mine, I was looking for a way to do it the other way around (from www to non www). used this simple solution: RewriteCond %{HTTP_HOST} ^www\.shop\.se [NC] RewriteRule ^(.*)$ http://shop.se/$1 [L,R=301 Btw, if wanting to change an old url to a new one, should not this work (just moved a shop from another server, and changed urls hence the need of redirects) RewriteCond %{HTTP_HOST} ^shop.se$ RewriteRule /sv/001.html$ http://shop.se/5705375251556.html [R=301,L] Working multishop btw. Regards 1 Link to comment Share on other sites More sharing options...
zzseba Posted December 7, 2016 Share Posted December 7, 2016 try this: add this to the top of your .htaccess file..ensures www <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] </IfModule> Hi El Patrón. I have the same problem, but the opposite... I created a multistore and add domains to each store, without www, works fine, until i try to access one of the stores with www and redirects to the main store. How can i solve this? Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts