mohsart Posted December 13, 2012 Share Posted December 13, 2012 I feel blind, I cannot find where to change so that the url works both with and without www in 1.5 /Mats Link to comment Share on other sites More sharing options...
El Patron Posted December 13, 2012 Share Posted December 13, 2012 try adding this to your .htaccess.... RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] Link to comment Share on other sites More sharing options...
mohsart Posted December 13, 2012 Author Share Posted December 13, 2012 Didn't work. Is this setting removed from the BO? Why? /Mats Link to comment Share on other sites More sharing options...
El Patron Posted December 13, 2012 Share Posted December 13, 2012 for that not to work seems impossible...unless you are running on windows...or dont have mod rewrite... where in the .htaccess file di you place it? do you have the www in the back office? Link to comment Share on other sites More sharing options...
mohsart Posted December 13, 2012 Author Share Posted December 13, 2012 The shop is at mohsart.se/handkraft Putting the line in mohsart.se/handkraft/.htaccess made www->page not found Putting in in mohsart.se/.htaccess made my other shop inaccessible. I use windows, but the shop is on linux. Not sure what you mean with "www in the back office", I use the url without www normally. /Mats Link to comment Share on other sites More sharing options...
El Patron Posted December 13, 2012 Share Posted December 13, 2012 in the back office, prefix your shop url with www. this was when the htaccess code executes for non-www (i.e inserts the www) it will match your 1.5.2 shop url.... 1 Link to comment Share on other sites More sharing options...
mohsart Posted December 14, 2012 Author Share Posted December 14, 2012 Ok... I set the domain to www.mohsart.se in preferences/SEO & URLs and it kind of works, but www is now default, i.e. mohsart.se/handkraft is directed to www.mohsart.se/handkraft - I'd like the oposite behaviour, like I have with mohsart.se. Some (all?) "sub urls", e.g. mohsart.se/handkraft/sv/ gives me Page not found. Again, I'd like the same behaviour as I have with mohsart.se /Mats Link to comment Share on other sites More sharing options...
scottm Posted December 14, 2012 Share Posted December 14, 2012 Hello mohsart, I tried what you were describing and had the same issue. The way I fixed it was to ensure the SEO & URLs section did NOT have www in front of my shop name. After checking that, I added the following code in the .htaccess for the folder where the shop exists: #Force non-www: RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com [NC] RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301] Now my shop resolves to yourdomain.com even if I enter www.yourdomain.com. I also tested this on different pages around my shop and they all remove the www without giving an error. See if that works for you. Best Regards, Scott M 1 Link to comment Share on other sites More sharing options...
El Patron Posted December 14, 2012 Share Posted December 14, 2012 jajajaja...you can only please some of the people some of the time...glad you www and non www'ers got it sorted Link to comment Share on other sites More sharing options...
mohsart Posted December 15, 2012 Author Share Posted December 15, 2012 Thanks scottm. However, applying that made all pages 404 page not found :-( /Mats Link to comment Share on other sites More sharing options...
dsimms Posted December 16, 2012 Share Posted December 16, 2012 I actually tried putting this rule in htaccess... all i got was this: This webpage has a redirect loop I guess i have to put www in the backoffice url... otherwise, I am just not sure... Hello mohsart, I tried what you were describing and had the same issue. The way I fixed it was to ensure the SEO & URLs section did NOT have www in front of my shop name. After checking that, I added the following code in the .htaccess for the folder where the shop exists: #Force non-www: RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com [NC] RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301] Now my shop resolves to yourdomain.com even if I enter www.yourdomain.com. I also tested this on different pages around my shop and they all remove the www without giving an error. See if that works for you. Best Regards, Scott M Link to comment Share on other sites More sharing options...
dsimms Posted December 16, 2012 Share Posted December 16, 2012 (edited) I would not advise you to do both since google will see this as duplicate content... ie: www.domain.com/coder-for-hire domain.com/coder-for-hire You should pick one or the other, then stay with that... most prof sites go with www.domain.com If you set it up for www.domain.com, then anyone that goes to domain.com will be pointed over to www.domain.com I feel blind, I cannot find where to change so that the url works both with and without www in 1.5 /Mats Edited December 16, 2012 by dsimms (see edit history) 2 Link to comment Share on other sites More sharing options...
mohsart Posted December 16, 2012 Author Share Posted December 16, 2012 This may be true for your country but in Sweden www is considered deprecated. Point taken about google though. Perhaps that's the reason why this feature was removed in 1.5? I've removed the code from .htaccess and www in BO, but still get page not found when trying to access my shop :-/ /Mats Link to comment Share on other sites More sharing options...
dsimms Posted December 16, 2012 Share Posted December 16, 2012 i am not sure how new your domain is, or if you just recently moved hosts.... I just changed hosts myself, moved the files from the old host to the new host, changed the dns, and for two days I got page not found because i was still pointed to the old host that no longer had any files, and dns had not fully updated.... did you recently change hosts, and dns? if so, you maybe waiting for the dns to fully update. if this is not the case, then I would know what your issue is, maybe a file was removed, maybe something got corrupt, i just do not know enough about presta yet... This may be true for your country but in Sweden www is considered deprecated. Point taken about google though. Perhaps that's the reason why this feature was removed in 1.5? I've removed the code from .htaccess and www in BO, but still get page not found when trying to access my shop :-/ /Mats Link to comment Share on other sites More sharing options...
mohsart Posted December 16, 2012 Author Share Posted December 16, 2012 No. ;-) I removed .htaccess and let PS regenerate it and now it's back to normal. So something was wrong in the file. I will drop this now since I will move to a new hosting company as soon as I dare i.e. after new year. BTW I tried scottm's fix again and it doesn't change the behaviour I have without it, possibly because I have one shop in the root and another in a subfolder. /Mats Link to comment Share on other sites More sharing options...
scottm Posted December 17, 2012 Share Posted December 17, 2012 Hello mohsart, Let us know how the new host works out for you. At first I had a bit of issue getting the rewrite to work, but it was due to my editing of the .htaccess file. I had the www rewrite crisscrossed with the URL in the BO. Best Regards, Scott M Link to comment Share on other sites More sharing options...
Recommended Posts