KntQ Posted March 16, 2018 Share Posted March 16, 2018 Hello, I have setup the prestahop on the https://domain.com , but now if I want to write in the browser URL field the https://www.domain.com I'm automaticaly redirect to the domain without WWW. How can I achieve that the site would be redirected to the WWW version? I use Prestashop 1.7.3 Best Regards, Dev Link to comment Share on other sites More sharing options...
JohanLarsson26 Posted March 16, 2018 Share Posted March 16, 2018 Try to add this in your htaccess: RewriteEngine On RewriteCond %{HTTP_HOST} !^www.domain.com$ RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L] Johan Larsson Link to comment Share on other sites More sharing options...
KntQ Posted March 16, 2018 Author Share Posted March 16, 2018 I allready tried that but I get an error; ERR_TOO_MANY_REDIRECTS Link to comment Share on other sites More sharing options...
musicmaster Posted March 16, 2018 Share Posted March 16, 2018 (edited) You can put something in your config.inc.php like: if($_SERVER['SERVER_NAME'] == "myshop.com") header('Location: https://www.myshop.com'.$_SERVER['REQUEST_URI']); I haven't tested it but this should work. Edited March 16, 2018 by musicmaster (see edit history) Link to comment Share on other sites More sharing options...
jetway Posted March 16, 2018 Share Posted March 16, 2018 (edited) you can set that at installation or update your installation settings. If your installation is without www. and you set your htaccess to www. it will loop and result in a to many redirects error Edited March 16, 2018 by jetway (see edit history) Link to comment Share on other sites More sharing options...
KntQ Posted March 17, 2018 Author Share Posted March 17, 2018 16 hours ago, musicmaster said: You can put something in your config.inc.php like: if($_SERVER['SERVER_NAME'] == "myshop.com") header('Location: https://www.myshop.com'.$_SERVER['REQUEST_URI']); I haven't tested it but this should work. I have put this code in the config.inc.php but I get an error; ERR_TOO_MANY_REDIRECTS Link to comment Share on other sites More sharing options...
KntQ Posted March 17, 2018 Author Share Posted March 17, 2018 13 hours ago, jetway said: you can set that at installation or update your installation settings. If your installation is without www. and you set your htaccess to www. it will loop and result in a to many redirects error And how can I update that in my installation settings? Link to comment Share on other sites More sharing options...
JohanLarsson26 Posted March 17, 2018 Share Posted March 17, 2018 Go to SEO & URL Do you have www there ? 1 Link to comment Share on other sites More sharing options...
KntQ Posted March 17, 2018 Author Share Posted March 17, 2018 7 minutes ago, JohanLarsson26 said: Go to SEO & URL Do you have www there ? Thank you. I just needed to change the domain name to www in SEO & URL section and it works now. 2 Link to comment Share on other sites More sharing options...
Damián Pérez Posted July 1, 2021 Share Posted July 1, 2021 On 3/17/2018 at 6:02 AM, KntQ said: Thank you. I just needed to change the domain name to www in SEO & URL section and it works now. I've the same problem. I don't understand what I have write in SEO and URL: "www" "www." "www.myshop.com" ? Please help me! Link to comment Share on other sites More sharing options...
Damián Pérez Posted July 1, 2021 Share Posted July 1, 2021 just only WWW? that's my question without a dot or a full domine? 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