Jump to content

[SOLVED] Multi-Store redirect issue: does not redirect without www


Recommended Posts

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 by FredActin (see edit history)
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 10 months later...

@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

  • Like 1
Link to comment
Share on other sites

  • 2 years later...

 

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

×
×
  • Create New...