Jump to content

[SOLVED] Multistore domain www suffix problem


minervalabs

Recommended Posts

Hello,

 

I am testing the multistore feature,

I have two domains pointing to the server hosting Prestashop.

one domain being the alias of the other through the Plesk interface.

So therefore, the multistore feature works...

 

However, the alias domain without the www. prefix redirects to the main domain, i.e

 

www.maindomain.com = Multistore 1 - correct

 

www.alias-domain.com = Multistore 2 - correct

 

But:

 

http://alias-domain.com = Multistore 1 - Not correct

 

 

I just can't figure how to solve it, I guess it must be some configuration of .htaccess.

 

Does anyone know how this might be fixed?

 

Cheers,

Link to comment
Share on other sites

Thanks for the quick reply,

 

I pasted the script you provided but now both the prefix and without of the alias domain went to the main domain (I replaced domain.com with the correct one in the code provided)

 

But the htaccess file generated by Prestashop is so complex and its beyond me at the moment,

So I'm not sure where to position the above lines as I presume the order has an effect on the existing lines which effects redirection etc

 

many thanks,

Link to comment
Share on other sites

thanks, I took a look at the thread has helped me test some things.

 

I am using default theme for a clean install version : 1.5.3.1

 

I pasted the custom code above and then below the "# ~~start~~" # ~~end~~

 

I have tested with and without "Automatically redirect to Canonical URL" + with and without friendly URLs."

 

But still the redirect doesn't work, if you know of anything else, that would be great.

 

cheers,

Link to comment
Share on other sites

ok, with all of the different configurations I've tested, I originally must have missed which way round the non-url was, because from the original you have provided:

 

RewriteEngine On

RewriteCond %{HTTP_HOST} ^domain.com [NC]

RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

 

I have swapped it round to the following:

 

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www.domain.com [NC]

RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

 

And its working! So thanks very much for your help, much appreciated.

  • Like 1
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...