Jump to content

Problem redirect multistore


ThibautMT

Recommended Posts

Hi,

I am using multistore with 2 different domains in my shop. I use both address without www. I have a problem with redirection when the customer uses a link with www.

https://domain1.com (main domain) and https://domain2.com are working with no problem

WHen customer visits www.domain1.com it redirects to domain1.com - that's good.

But when the customer visits www.domain2.com it redirects to domain1.com (main domain) - this is not good and I do not know how to solvve it. I know I need to put some code in .htaccess but the code I have is wrong and causes the redirection error. Can anyone know how to solve this correctly?

Link to comment
Share on other sites

did you place it in the .htaccess file of the top directory...right within public_html. I also advice you to put it in the segment that covers your domain2  If RewriteEngine has been turned on at the beginning of the .htaccess you dont need to write that again. 

Link to comment
Share on other sites

Yes i placed it here

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>

RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.domain2.com [NC]
RewriteRule ^(.*)$ https://domain2.com/$1 [L,R=301]

 

I tried to put him too in the #Domain: domaine2.com part. I deleted all the cache from the backoffice, and from /var/cache, but it still doesn't work :/

Edited by ThibautMT (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...