fteng Posted August 25, 2009 Share Posted August 25, 2009 I just installed Prestashop and I'm having an issue with SSL enabled. When I checkout it goes to a secure HTTPS page; however all the links on the right menu are HTTP with port 443. When I click the link it doesn't work. Is there anyway to change it so that port 443 is not appended to non-SSL pages.In the screenshot, I'm in the authentication.php page which is HTTPS, but when I click the "Accessories" category the link is HTTP with port 443 instead of port 80. Not sure how to fix this. Link to comment Share on other sites More sharing options...
first1 Posted August 28, 2009 Share Posted August 28, 2009 if you think it is a bug, can you report it in http://www.prestashop.com/bug_tracker/ Link to comment Share on other sites More sharing options...
fteng Posted August 28, 2009 Author Share Posted August 28, 2009 I put in a workaround. The problem is in the $_SERVER['HTTP_HOST'] variable which includes the port of the current page. This makes sense when your in HTTPS, but when going back to HTTP it doesn't. I've noticed in some live prestashops that once in HTTPS, all pages are HTTPS even the catalog browsing. Because my host uses the default SSL port 443 for HTTPS, I just modified the init.php file and inserted a line to search for port 443 and delete it from the $_SERVER['HTTP_HOST'] variable. Quick and dirty.if (strpos($_SERVER['HTTP_HOST'],":443")>1) $_SERVER['HTTP_HOST'] = str_replace(":443","",$_SERVER['HTTP_HOST']); Link to comment Share on other sites More sharing options...
first1 Posted August 28, 2009 Share Posted August 28, 2009 where do you add those? which file do you modify? Link to comment Share on other sites More sharing options...
fteng Posted August 28, 2009 Author Share Posted August 28, 2009 I added the code to the init.php file in the application root directory. Right below the /* Server Params */ comment Link to comment Share on other sites More sharing options...
first1 Posted August 29, 2009 Share Posted August 29, 2009 I dont have php.ini in my folder.they use htaccess Link to comment Share on other sites More sharing options...
frontwards Posted November 11, 2009 Share Posted November 11, 2009 hello,I wanted to say that I was having the same problem - any dynamically generated links on my HTTPS pages were redirecting to HTTP://myurl:443... i'm on MediaTemple here, and found a similar fix for WordPress at: http://docs.shopplugin.net/Media_Temple_SSL_Redirect_Loopi inserted this line in my init.php file on line 107 (second line of Server Params section)...$server_host = str_replace(':443', '', $server_host);seems to be working so far... Link to comment Share on other sites More sharing options...
coalesce Posted March 13, 2010 Share Posted March 13, 2010 Wow... This seems like a HUGE bug? This really had me stumped... Link to comment Share on other sites More sharing options...
nemmon Posted May 3, 2010 Share Posted May 3, 2010 Hello, none of these solutions work for me.If I edit my init. file, my site comes up empty! Nothing. If I restore the original file the site comes up... Link to comment Share on other sites More sharing options...
nemmon Posted May 3, 2010 Share Posted May 3, 2010 Hello, none of these solutions work for me.If I edit my init. file, my site comes up empty! Nothing. If I restore the original file the site comes up... OK... so I at Mediatemple and none of the items above worked for me, I changed this:/* Server Params */$server_host = htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8');$protocol = 'http://';$protocol_ssl = 'https://';to This:/* Server Params */$server_host = htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8');$protocol = 'https://';$protocol_ssl = 'https://';It's working great! Link to comment Share on other sites More sharing options...
Penelope Posted June 26, 2010 Share Posted June 26, 2010 Just wondering if anyone has an alternate solution for this issue? My server can get slow sometimes and having all pages in SSL would make it too slow.And FYI, I'm running 1.3.1.1 and the solutions in posts #2 and #6 don't work in this version. The one in #9 does work, but I'd rather only have SSL enabled on checkout and account pages.Thanks in advance for any help! 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