AFemaleProdigy Posted December 1, 2012 Share Posted December 1, 2012 (edited) I have been noticing some problems lately and am not sure what the issue is. The major problem is that users cannot login in front office. They enter login info (including myself) and they get redirected back to the login page like nothing happened and they are not logged in. We have tried clearing cookies, clearing cache, using different browsers, and none of it works. Also, I noticed that I sometimes when I try to view the products list in BO catalog, the products do not show up. I have to clear cookies and log back in to see it. The issue comes right back after I try to use the stock management page sorting tools. I have had ongoing cookie problems for some time now that seem to come and go oddly. Please help asap. All my sales have stopped. Version 1.5.2 Edited December 1, 2012 by AFemaleProdigy (see edit history) Link to comment Share on other sites More sharing options...
josecar Posted December 1, 2012 Share Posted December 1, 2012 (edited) funny thing, i had the same issue when I installed the latest 1.5.2 version, so I'm currently with a 1.5.2 version I downloaded a month ago wich has different issues, but not so critical. What is no joke is this: I have two 1.5.2 versions with different authentication.tpl files, with same file version number and different content. And both give different problems. The guys at Presta gonna have a nightmare sorting bugs, as same versions give different behavior.... and users are lost in a maze, too bad Edited December 1, 2012 by josecar (see edit history) 1 Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 1, 2012 Author Share Posted December 1, 2012 (edited) I noticed something that might be causing a conflict. In the shop domain and ssl domain, I had the www in there. I also had canonical redirect setting turned on. I removed the www, turned off canonical and back on, then reset the friendly url to on and the login is working again. However, the canonical redirect is NOT working. i tried turning it off and on, but will will not redirect to www. I think that there may be a conflict if you add the www to the domain settings while also enabling the canonical redirect setting. If that is the case, there should be a note in BO that says "do not add www". Can anyone else confirm this? I got the idea when I saw the suggested solution for other people was to remove the www. I do not want to use my site without the www, so I need a solution. Edited December 1, 2012 by AFemaleProdigy (see edit history) Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 1, 2012 Author Share Posted December 1, 2012 (edited) Oh... I see... so the canonical redirect is just redirecting to what I set in the domain. Not specifically the www. I tried adding the www to the domain settings again and testing with canonical redirect on/off and find that no one can log in again. What is the problem and how do I get it to use the www? Edited December 1, 2012 by AFemaleProdigy (see edit history) Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 1, 2012 Author Share Posted December 1, 2012 (edited) I just realized something. The friendly urls are not getting updated when a change is made to the canonical url setting or the domain setting. You have to enable/disable the friendly url to get the correct updated htaccess. This is a problem as people do not know to change those settings in that order. You can see what I mean if you view your current htaccess file on the server with the following steps... Have friendly urls on. Note what your current domain url is (with or without www). View your htaccess file on the server. Note the structure of the friendly urls (with/without www). Now change the domain url in BO to the opposite (with/without) www. Refresh your view of the htaccess on the server. Note that the primary domain setting changes, but the friendly url settings do not update to reflect the domain change. Now go into BO and disable/enable friendly urls. Refresh your view of htaccess again and you will see the friendly urls are now showing the correct structure. If my testing is correct, which I believe it is, this would be why so many people get confused and why it seems that the settings are not working. I think some testing needs to be done in regards to how the changes to these settings are applied to the htaccess when they are done in variable order. Someone please test and confirm this issue. Also, this realization has not corrected my issue of not being able to login on the www domain. Edited December 1, 2012 by AFemaleProdigy (see edit history) Link to comment Share on other sites More sharing options...
Dh42 Posted December 1, 2012 Share Posted December 1, 2012 I would consider that normal behavior that it would not regenerate the .htaccess until you asked it to. Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 1, 2012 Author Share Posted December 1, 2012 (edited) How would changes to those settings be applied then if the system does not regenerate the htaccess file? The typical user might change the domain url, but not know that they need to disable and re-enable the friendly seo setting so all their urls are updated accordingly. That would then cause all kinds of problems. Like I experienced. If you search google for similar issues, you will see a lot of people have posted issues pertaining to this, which I believe could all be tied in to the way these settings are handled. You can't change the domain url and not update the friendly urls without having problems, which is what is happening. Changing a setting like canonical urls, domain url, and ssl domain should auto generate an updated htaccess. Or, there should be a button to generate the htaccess in that section with a note that says you must do it to enable the changes. It makes no sense that you would have the options to change the settings, but not apply them correctly and automatically to the htaccess. Edited December 1, 2012 by AFemaleProdigy (see edit history) Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 1, 2012 Author Share Posted December 1, 2012 So any idea why users get redirected back to the login page when I have the www domain enabled? Link to comment Share on other sites More sharing options...
Dh42 Posted December 2, 2012 Share Posted December 2, 2012 I didn't have a chance to look at it with the www. on it before you disabled it. Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 2, 2012 Author Share Posted December 2, 2012 (edited) I didn't have a chance to look at it with the www. on it before you disabled it. I turned it back on, so the problem is back. Please check it out asap. It is returning customers trying to log in and new customers on the second registration step that get redirected back to the login page. This is only a problem when using the www domain. Not a problem without it. Also, you can message me on the store's skype if you want. buyrotmgitems Edited December 2, 2012 by AFemaleProdigy (see edit history) Link to comment Share on other sites More sharing options...
Dh42 Posted December 2, 2012 Share Posted December 2, 2012 Turn it off now, I want to see something. Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 2, 2012 Author Share Posted December 2, 2012 Ok, it is back off again. Link to comment Share on other sites More sharing options...
Dh42 Posted December 2, 2012 Share Posted December 2, 2012 I had no problem logging in. It was the logging out that was the problem. If i rewrote the post url to not use a www. I could log out though. Do you use skype to message by any chance? Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 2, 2012 Author Share Posted December 2, 2012 Yes, I said you can skype me at buyrotmgitems Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 2, 2012 Author Share Posted December 2, 2012 Did you try to log back in after you had logged out... before I removed the www? Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 2, 2012 Author Share Posted December 2, 2012 Dh42 wasn't able to help me. Anyone else? Link to comment Share on other sites More sharing options...
El Patron Posted December 2, 2012 Share Posted December 2, 2012 (edited) When developing my own multishop I had issues with www or lack of. If you would like to try this, it resolved it the issue for 1.3 and 1.4. Note not tested on a 1.5. Place the code in config/config.inc.php after the loadConfiguraiton call. $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']); if (str_replace('www.', null, Configuration::get('PS_SHOP_DOMAIN')) == (str_replace('www.', null, $host))) Configuration::set('PS_SHOP_DOMAIN', $host); fingers crossed Edited December 2, 2012 by elpatron (see edit history) Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 2, 2012 Author Share Posted December 2, 2012 When developing my own multishop I had issues with www or lack of. If you would like to try this, it resolved it the issue for 1.3 and 1.4. Note not tested on a 1.5. Place the code in config/config.inc.php after the loadConfiguraiton call. $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']); if (str_replace('www.', null, Configuration::get('PS_SHOP_DOMAIN')) == (str_replace('www.', null, $host))) Configuration::set('PS_SHOP_DOMAIN', $host); fingers crossed How should I have the BO settings in conjunction with this code? Link to comment Share on other sites More sharing options...
El Patron Posted December 2, 2012 Share Posted December 2, 2012 How should I have the BO settings in conjunction with this code? with out without a www...it should make no difference as we are setting the shop domain to whatever is in the http... Link to comment Share on other sites More sharing options...
El Patron Posted December 4, 2012 Share Posted December 4, 2012 well? Did you fix it..or just give up? Link to comment Share on other sites More sharing options...
todaytonight Posted December 4, 2012 Share Posted December 4, 2012 I have same issue in v1.5.2 and I have post a topic here: http://www.prestashop.com/forums/topic/207419-users-cant-login-v152-in-firefox/page__p__1023059 Link to comment Share on other sites More sharing options...
El Patron Posted December 4, 2012 Share Posted December 4, 2012 When developing my own multishop I had issues with www or lack of. If you would like to try this, it resolved it the issue for 1.3 and 1.4. Note not tested on a 1.5. Place the code in config/config.inc.php after the loadConfiguraiton call. $host = (isset($_SERVER['HTTP_X_FORWARDED_HOST']) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST']); if (str_replace('www.', null, Configuration::get('PS_SHOP_DOMAIN')) == (str_replace('www.', null, $host))) Configuration::set('PS_SHOP_DOMAIN', $host); fingers crossed I have same issue in v1.5.2 and I have post a topic here: http://www.prestasho...age__p__1023059 I am asking if they tried the code I suggested. Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 5, 2012 Author Share Posted December 5, 2012 Elpatron, sorry I was offline for a while dealing with my laptop crashing. I have not had a chance to try your suggestion, but will in the next day or two and let you know if it works. Thanks! Link to comment Share on other sites More sharing options...
jorbarca Posted December 5, 2012 Share Posted December 5, 2012 Hi, I have the same problem in version 1.5.0.17. I tried the code Elpatron and it does not work. I'm desperate with this problem. does not help me migrate to 1.5.2 as it has the same problem. You can confirm that funcioan Elpatron code in 1.5.2? Thank you. jorbarca. Link to comment Share on other sites More sharing options...
El Patron Posted December 5, 2012 Share Posted December 5, 2012 just finished looking at 1.5.2 based system on the localhost...I don't have a remote install to test this with...but from doing some searches I do not think the code would work on 1.5. try this; set your url in the back office with www then add this to your .htaccess, this will set all inbound url's with www. RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 2 Link to comment Share on other sites More sharing options...
nal Posted December 12, 2012 Share Posted December 12, 2012 I am asking if they tried the code I suggested. I have tested your code and it looks like it is working for me. To be confirmed but looks ok now. Thanks Link to comment Share on other sites More sharing options...
perino Posted December 12, 2012 Share Posted December 12, 2012 Thanks elpatron, I found your workaround extremely useful and it looks like it fixes the issue. 1 Link to comment Share on other sites More sharing options...
El Patron Posted December 13, 2012 Share Posted December 13, 2012 (edited) oops...deleted..posted to wrong thread... Edited December 13, 2012 by elpatron (see edit history) Link to comment Share on other sites More sharing options...
jimmyc Posted December 13, 2012 Share Posted December 13, 2012 just finished looking at 1.5.2 based system on the localhost...I don't have a remote install to test this with...but from doing some searches I do not think the code would work on 1.5. try this; set your url in the back office with www then add this to your .htaccess, this will set all inbound url's with www. RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] Where do it add this code in htaccess? Do I replace the code in red here?? comment when .htaccess will be generated again # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution # http://www.prestashop.com - http://www.prestashop.com/forums <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^www.mydomain.com$ RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] # Images thanks in advance Link to comment Share on other sites More sharing options...
El Patron Posted December 13, 2012 Share Posted December 13, 2012 (edited) Where do it add this code in htaccess? Do I replace the code in red here?? comment when .htaccess will be generated again # .htaccess automaticaly generated by PrestaShop e-commerce open-source solution # http://www.prestashop.com - http://www.prestashop.com/forums <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^www.mydomain.com$ RewriteRule . - [E=REWRITEBASE:/] RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L] # Images thanks in advance yes in your .htaccess...do not change anything... RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] Edited December 13, 2012 by elpatron (see edit history) Link to comment Share on other sites More sharing options...
jimmyc Posted December 13, 2012 Share Posted December 13, 2012 Ok that didn't work for me. The thing is users can login is firefox but not chrome or explorer. Link to comment Share on other sites More sharing options...
El Patron Posted December 13, 2012 Share Posted December 13, 2012 Ok that didn't work for me. The thing is users can login is firefox but not chrome or explorer. that sucks...sounds to me like a theme issue...are you using default ps theme...or another theme? if another theme...and if you are comfortable (i'd back up my site first) revert to default ps theme...maybe post your url as well... Link to comment Share on other sites More sharing options...
jimmyc Posted December 13, 2012 Share Posted December 13, 2012 Chrome worked the other day though. before i changed the store to www. prefix Still think it's the theme. I am using a prestatheme maker theme http://prestashop-theme-maker.com Link to comment Share on other sites More sharing options...
El Patron Posted December 13, 2012 Share Posted December 13, 2012 Chrome worked the other day though. before i changed the store to www. prefix Still think it's the theme. I am using a prestatheme maker theme http://prestashop-theme-maker.com don't know...I fixed my 1.4 with php code...i.e. my multishop module will compare in bound http to our table of domains (but not comparing with www), if it matches it will update the shop url...I don't run a prod 1.5 shop...and my 1.4 code will not work in a 1.5 shop...maybe someday... Link to comment Share on other sites More sharing options...
jimmyc Posted December 13, 2012 Share Posted December 13, 2012 Well for some reason it is worlking now. I forced the theme to recompile. and flicked some of the caching settings on and off before that. Thanks for the assistance elpatron Not sure what fixed it though. I might compare the htaccess file to the one i backed up before i did all of this to see if there is a difference. Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 17, 2012 Author Share Posted December 17, 2012 I want to point out that changing some settings in BO will cause the htaccess file to be overwritten by the system and updated. Won't that overwrite any of the manual changes made that elpatron suggested adding to the htaccess? Thus, making the fix break if you ever try to change certain settings in BO? Link to comment Share on other sites More sharing options...
El Patron Posted December 17, 2012 Share Posted December 17, 2012 I want to point out that changing some settings in BO will cause the htaccess file to be overwritten by the system and updated. Won't that overwrite any of the manual changes made that elpatron suggested adding to the htaccess? Thus, making the fix break if you ever try to change certain settings in BO? this is a correct statement...they would be overwritten...and 1.5 no longer has the .htaccess panel to add manually.... Link to comment Share on other sites More sharing options...
jimmyc Posted December 17, 2012 Share Posted December 17, 2012 And just to add. This is not actually working. Still getting problems. I hear a sw update is coming shortly??? Link to comment Share on other sites More sharing options...
El Patron Posted December 17, 2012 Share Posted December 17, 2012 And just to add. This is not actually working. Still getting problems. I hear a sw update is coming shortly??? not working for you..but for some....what a mess Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted December 18, 2012 Author Share Posted December 18, 2012 what a mess .... indeed 1 Link to comment Share on other sites More sharing options...
monstercreativestudio Posted December 18, 2012 Share Posted December 18, 2012 i have same issue! can't login to frontend. I moved just migrated my site to a new server and can't figure out whats going on. i can still signup, just can't login! Link to comment Share on other sites More sharing options...
Since1953 Posted January 31, 2013 Share Posted January 31, 2013 We are having the same issue. I just made those changes to the .htaccess file and we'll see if that fixes anything, but it sounds like this is an issue for many people. Link to comment Share on other sites More sharing options...
mazsihej Posted February 22, 2013 Share Posted February 22, 2013 i also have the same issue. it's coming and going. cannot login to front office. also when i face the issue (cannot login), i face a cart issue too, i cannot add only one product. when i add another product, cart is erased and i'll have the latest added product in cart. when i have a product in cart, and i just browse to another product, cart content is lost. I have this with all browsers randomly. if i clear all browsing data, site works again for a while. i'm not sure what causes issue to occur again, but when it occurs, i doesn't disappear until i clear all browsing data (cache cookies etc). Link to comment Share on other sites More sharing options...
AFemaleProdigy Posted March 31, 2013 Author Share Posted March 31, 2013 i also have the same issue. it's coming and going. cannot login to front office. also when i face the issue (cannot login), i face a cart issue too, i cannot add only one product. when i add another product, cart is erased and i'll have the latest added product in cart. when i have a product in cart, and i just browse to another product, cart content is lost. I have this with all browsers randomly. if i clear all browsing data, site works again for a while. i'm not sure what causes issue to occur again, but when it occurs, i doesn't disappear until i clear all browsing data (cache cookies etc). Try using http://yourdomain.com to login and then http://www.yourdomain.com (note the www). See if one lets you log in. There seems to be a lot of issues with the htaccess and friendly url settings. Link to comment Share on other sites More sharing options...
Andrej Stas Posted April 13, 2013 Share Posted April 13, 2013 Chrome worked the other day though. before i changed the store to www. prefix Still think it's the theme. I am using a prestatheme maker theme http://prestashop-theme-maker.com Just a small note - the project has been moved to a new domain: presta-theme-maker.com Link to comment Share on other sites More sharing options...
w3bsolutions Posted November 11, 2013 Share Posted November 11, 2013 I am having this issue on PS 1.5.6 on multishop environment. I have to shops: Shop A and Shop B. If set the main URL of each shop with "www" the users cannot login on the frontend, you just get redirected to the same page and nothing happens. If I set the main URL of each shop without "www" and add the domain with "www" as a secondary domain I have the same issue. But if I don't add both domains (with and without "www") for each shop, if I type the domain for Shop B with www (or w/o, depending on what is set up on the BO), I get redirected to the main domain on shop A, which is pretty bad... because it is a different site. Is nobody else having this issue? Any idea? Link to comment Share on other sites More sharing options...
office_axel_company Posted April 7, 2017 Share Posted April 7, 2017 Hi, i had the same problem, for me the problem was friendly URL, if i deactivated the site work fine. Hope i help you Link to comment Share on other sites More sharing options...
Recommended Posts