minervalabs Posted July 11, 2013 Share Posted July 11, 2013 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 More sharing options...
El Patron Posted July 11, 2013 Share Posted July 11, 2013 one of the easier ways is as you pointed out .htaccess RewriteEngine On RewriteCond %{HTTP_HOST} ^domain.com [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] Link to comment Share on other sites More sharing options...
minervalabs Posted July 11, 2013 Author Share Posted July 11, 2013 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 More sharing options...
El Patron Posted July 11, 2013 Share Posted July 11, 2013 possibly this will help http://www.prestashop.com/forums/topic/2131[spam-filter]tip-15-and-custom-htaccess/ Link to comment Share on other sites More sharing options...
minervalabs Posted July 12, 2013 Author Share Posted July 12, 2013 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 More sharing options...
El Patron Posted July 12, 2013 Share Posted July 12, 2013 when you say it did not work for you, do you mean in the browser bar you still saw the non-www url? also when you turned on friendly url's, did you see friendly urls? Link to comment Share on other sites More sharing options...
minervalabs Posted July 12, 2013 Author Share Posted July 12, 2013 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. 1 Link to comment Share on other sites More sharing options...
El Patron Posted July 12, 2013 Share Posted July 12, 2013 good news...sorry I thought you had wanted the www...I will mark this as solved then. happy selling Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now