deepee Posted December 5, 2012 Share Posted December 5, 2012 Hi All I thought I'd got everything set up properly since my upgrade to 1.5.2 but picked up a serious problem when trying to access the site using http://www.myshop.com.au It goes to the homepage but all the images are missing. There's no problem if I go to http://myshop.com.au If I then go to a product or category page using www I redirect to the 404 page. Even worse if I use https://www.myshop.com.au which generates SSL error warnings in IE and stops. Again everything is fine for SSL and non SSL URL's if accesses from http://myshop.com.au In "Preferences > SEO & URLs" I have :- Shop Domain: myshop.com.au SSL Domain: myshop.com.au Base URI: / In "Advanced Parameters > Configuration Information > View" I have :- Prestashop version: 1.5.2.0 Shop URL: https://myshop.com.au/ This would seem wrong in relation to the settings in preferences but I don't know where else to go to change it. I should also mention I've tried setting Canonical URL's to "on" but that results in the browser hanging completely. Can someone please tell me where else these URL's need to be defined as I see a lot of conflicting information about this. Thanks deepee Link to comment Share on other sites More sharing options...
deepee Posted December 5, 2012 Author Share Posted December 5, 2012 Anyone? Link to comment Share on other sites More sharing options...
El Patron Posted December 6, 2012 Share Posted December 6, 2012 Try this: from your back office remove the www from shop URL - and turn on "Automatically redirect to Canonical URL" enabled. then clear browser cache and cookies... Link to comment Share on other sites More sharing options...
deepee Posted December 6, 2012 Author Share Posted December 6, 2012 Thanks, for that. I have been testing it with and without canonical URL set but it didn't work. I should mention that I test using IE, set to clear all history and caches each time it shuts down. I also had a look at .htaccess but find that you can't set up redirects from www to root any more. Unfortunately I've had to re-instate my pre-upgrade site in the interim because of the inconsitencies and critical issues over the last 10 days and a huge loss of business. Not my prefered option as I've put in many, many hours to get it to the point of going live. Link to comment Share on other sites More sharing options...
tomerg3 Posted December 6, 2012 Share Posted December 6, 2012 Never ever try to upgrade a live site, that is the biggest no-no. Make a (Dev) copy of the site, try to upgrade the dev, take notes of every change you make, and only after you have tested everything on the dev site (registration + cart + checkout), do the same to the live site. Redirecting from www to non-www (or the other way) is best to be done from htacess file, you can see an example at http://www.presto-changeo.com/en/content/6-prestashopseotips 1 Link to comment Share on other sites More sharing options...
safa Posted December 6, 2012 Share Posted December 6, 2012 you can use htacess redirect. this site create htaccess redict code. http://htaccessredirect.net/index.php generate your redirect code, and copy past your htaccess file. Link to comment Share on other sites More sharing options...
deepee Posted December 6, 2012 Author Share Posted December 6, 2012 (edited) Thanks for the replies. FYI the site was upgraded offine on a local VM running LAMPP and tested thoroughly before going live. It's only when the live shop URL's needed to be changed from localhost that the wheels started coming off. I'm familiar with .htaccess redirects but the auto generated code in prestashop looks very different:- <code> <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^mysite.com.au$ RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] </code> What I should have would look like this:- <code> RewriteCond %{HTTP_HOST} ^www.mysite.com.au$ [NC] RewriteRule ^(.*)$ http://mysite.com.au/$1 [R=301,L] </code> So if I change it what effect is it going to have on these other strange rewrite rules? Also In "Advanced Parameters > Configuration Information > View" I have :- Prestashop version: 1.5.2.0 Shop URL: https://myshop.com.au/ Where did it pick the https URL from as I didn't set it? As mentioned, the ideal would be to have a detailed list of where the shop URL's appear in the database, and in which files, so they can be checked to make sure that upgrade routines etc. haven't changed them to invalid values. Edited December 6, 2012 by deepee (see edit history) Link to comment Share on other sites More sharing options...
tomerg3 Posted December 6, 2012 Share Posted December 6, 2012 The URLs are stored in the ps_configuration table (search for %shop%), as well as ps_shop_url Link to comment Share on other sites More sharing options...
deepee Posted December 6, 2012 Author Share Posted December 6, 2012 Thanks, I'll check that out. I also hope someone can throw some light on the correct .htaccess rewrite configuration. Link to comment Share on other sites More sharing options...
deepee Posted December 7, 2012 Author Share Posted December 7, 2012 Just to rephrase that, can anyone tell me how I can get my own rewrite code into the autogenerated prestashop .htaccess code without breaking anything? (I mean I do know how to edit and merge the file, just not the effect of doing so.) I have no idea what the autogenerated rewrites do and I hope someone can explain. Prestashop auotogenerated .htaccess:- <code> <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^mysite.com.au$ RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] </code> What I believe I need to include to get www to resolve to root:- <code> RewriteCond %{HTTP_HOST} ^www.mysite.com.au$ [NC] RewriteRule ^(.*)$ http://mysite.com.au/$1 [R=301,L] </code> Link to comment Share on other sites More sharing options...
deepee Posted December 7, 2012 Author Share Posted December 7, 2012 I just tried adding "RewriteRule ^(.*)$ http://mysite.com.au/$1 [R=301,L]" above "RewriteRule . - [E=REWRITEBASE:/]" It breaks product images loading on the homepage and reults in 404's for every page accessed thereafter. Where then can I define the rule for www.mysite.com.au to rewrite to mysite.com.au? This seems such a fundamental issue, surely someone knows the answer! Any developer's support staff reading the forum? Link to comment Share on other sites More sharing options...
deepee Posted December 7, 2012 Author Share Posted December 7, 2012 Another report of the same issue is here:- http://www.prestashop.com/forums/topic/209278-prestashop-with-www-doesnt-work/ Link to comment Share on other sites More sharing options...
thrivenutrition Posted January 15, 2013 Share Posted January 15, 2013 I have recently upgraded to 1.5 and have been experiencing the same error message. I am not familiar with coding so I am lost as well. Any new info Deepee would be apprieciated. Link to comment Share on other sites More sharing options...
hextor Posted March 4, 2013 Share Posted March 4, 2013 I had the same ploblem. Just get into the control panel Preferences>SEO URL> when you change "Automatically redirect to Canonical URL" option from yes to no and visa versa it creates a new .htaccess file. Setup your your shop domain and ssl properly ....and toggle and save Automatically redirect to Canonical URL option 1 Link to comment Share on other sites More sharing options...
thrivenutrition Posted March 9, 2013 Share Posted March 9, 2013 @hextor I will try that out and let you know how it turns out. Link to comment Share on other sites More sharing options...
deepee Posted March 9, 2013 Author Share Posted March 9, 2013 This topic may help : http://www.prestashop.com/forums/topic/209598-solved-canonical-url-issue-with-friendly-urls-in-152/page__p__1034727#entry1034727 Link to comment Share on other sites More sharing options...
thrivenutrition Posted March 22, 2013 Share Posted March 22, 2013 @deepee. I changed the code and it worked like a charm. No issue after changing it about 1 month ago. Thanks for the help! Link to comment Share on other sites More sharing options...
Recommended Posts