fishordog Posted February 15, 2014 Share Posted February 15, 2014 i'm using 1.5.5.0. i have no problem accessing my site without www but when i try to add www manualy to some links(category, product) it doesn't redirect properly and adds "?controller=404". I added screenshot of my Seo&Url settings. Google indexed all my pages as "site.com" just fine without "?controller=404". Any advice on how to make them work with www without messing up SEO? Thanks Link to comment Share on other sites More sharing options...
indus Posted February 15, 2014 Share Posted February 15, 2014 That is how it seems to work in prestashop, not sure if its a bug or intended behaviour. Manually adding www to any url returns a 404 that is what you are saying correct ? Link to comment Share on other sites More sharing options...
vekia Posted February 15, 2014 Share Posted February 15, 2014 it can be releated to the fact, that htaccess files wasn't reconfigured. in this case, try to manually remove it (backup it first) then save changes on preferences > seo & urls tab once again Link to comment Share on other sites More sharing options...
indus Posted February 15, 2014 Share Posted February 15, 2014 (edited) Does not work. Except for the home page. Any other domain returns a 404. It is not really important though for me. I use non-www only. I dont know why anyone would manually put a www on some url except the home page. But it is an observation i made when someone had a similar question. Edited February 15, 2014 by indus (see edit history) Link to comment Share on other sites More sharing options...
indus Posted February 15, 2014 Share Posted February 15, 2014 This is how my rewrite portion in htaccess looks like : RewriteEngine onRewriteCond %{HTTP_HOST} ^mydomainname$RewriteRule . - [E=REWRITEBASE:/]RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] Link to comment Share on other sites More sharing options...
indus Posted February 15, 2014 Share Posted February 15, 2014 (edited) Ok i have solved this problem, with some tip from here http://www.prestashop.com/forums/topic/2131[spam-filter]tip-15-and-custom-htaccess/ I used the code : RewriteEngine OnRewriteCond %{HTTP_HOST} !^mydomain$RewriteRule (.*) http://mydomain/$1 [R=301,L] and placed it at the top of the .htaccess file above the comments and it works fine now. Seems like the problem is with prestashop's default htaccess rewrite code. Now, all my www urls redirect properly to non - www ones without a 404 error. Though i still maintain its useless for me because i always used a non-www site, but probably useful for those who have had a www in their url's for a long time and decide to move to a non-www one so all their old links on google can redirect properly. Edited February 15, 2014 by indus (see edit history) 1 Link to comment Share on other sites More sharing options...
fishordog Posted February 15, 2014 Author Share Posted February 15, 2014 Thanks for all replies. I agree that this redirect would be useless 99% of the time, i just wanted to make it work in case someone back link one of my pages with www for some reason. I'll try all suggestions and see which one works Link to comment Share on other sites More sharing options...
Recommended Posts