AbanteCart Community

eCommerce construction => Installation and Configuration => Configuration => Topic started by: moosehound on May 18, 2016, 06:22:24 AM

Title: SSL/HTTPS automatic switching issue
Post by: moosehound on May 18, 2016, 06:22:24 AM
Hi,

I had SSL/HTTPS working just fine for a few days.  My host moved me to a new server and since then I've had issues with the site automatically changing to HTTPS. 

If I visit my site using the HTTPS prefix then it works just fine BUT if I visit using HTTP then click on Cart/Checkout/Register/Login/Account etc it does not flip over to HTTPS as it should.  I'm starting to lose my sense of humour about this as I keep getting issues with HTTPS and this server move hasn't helped at all :(

site is tranquili-tea dot co dot UK <- sorry I can't post links yet :(

Any help greatly received :)

Abantecart v1.2.7 is installed.
HTTPS is on
Store URL is set to http:// www dot tranquili-tea dot co dot uk/
SSL Store URL is set to https:// www dot tranquili-tea dot co dot uk/
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 18, 2016, 06:53:53 AM
Actually scratch that - I now just redirected to the HTTP site instead - so I'm not even getting served the HTTP certificate/site I don't think...

I do have the following in my htaccess file..:

RewriteCond %{HTTP_HOST} ^tranquili-tea dot co dot uk [NC]
RewriteRule ^(.*)$ http :// www dot tranquili-tea dot co dot uk/$1 [L,R=301]
Title: Re: SSL/HTTPS automatic switching issue
Post by: eCommerce Core on May 18, 2016, 08:04:10 AM
I see HTTPS and HTTP working on your site.
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 18, 2016, 08:06:24 AM
Really?  Why isn't it showing for me?  I've tried Safari, Chrome, Edge on 3 different devices.  I've even tried Phone and Tablet too yet I get the same problems.. :(  Caching?

I just get the regular site with HTTPS at the start but no lock/key symbol and no cert issued...

Thanks for looking :D
Title: Re: SSL/HTTPS automatic switching issue
Post by: llegrand on May 18, 2016, 04:25:55 PM
you can use this to check your ssl
https://www.sslshopper.com/ssl-checker.html (https://www.sslshopper.com/ssl-checker.html)

HTTPS is on
Store URL is set to http:// www dot tranquili-tea dot co dot uk/

Try  using https://  (that is the site you prefer)

you need to add the https into your .htaccess file for the where you have your store - if root,  then in htaccess root,  if in /dir  ,  in the /dir htaccess file
RewriteEngine on RewriteCond %{HTTPS} !=on RewriteRule (.*) https://example.com/$1 [R]

OR this
RewriteEngine on RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]





Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 19, 2016, 04:37:17 AM
Hi, thanks for the reply :)

So, I use that site and my SSL cert is being served just fine by the looks.

If I add either of those two lines to my htaccess I get Error 500 Internal Server Error and nothing is reachable until I comment those back out again (and yes I changed the domains to my domain ;) ).

What I DO get though when I try and use those lines in htaccess and get the error page is a green secure key next to the https address - so when the site fails to load/activate the store https secure connection appears to be fine.  This would lead me to believe something to do with the store loading or config is causing HTTPS to go wonky.  The only things I have added to my htaccess are the two lines in my post above that I use to redirect requests to tranquili-tea dot co dot uk to www dot tranquili-tea dot co dot uk.  That and the SEO stuff mentioned during setup.

Like I say this worked just fine for a few days then my web host managed to enter a duplicate SSL cert on my box which caused me issues.  They've removed this now and the cert seems to be dished out fine it's just that AbanteCart no longer seems to use it....

Thanks for all the help, it's really got me stumped....  should I just backup, wipe and reinstall?

:)
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 19, 2016, 07:53:30 AM
I've attached a screen shot (and my current htaccess) of the behaviour I am getting - here you can see that the site is loading over HTTPS, has a valid certificate yet still no secure "lock/key" symbol...

I can place something like:
 RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https :// <YOURURL> $1 [R,L]

in my htaccess but I still get the problem that the SSL portion just isn't engaging....
Title: Re: SSL/HTTPS automatic switching issue
Post by: llegrand on May 19, 2016, 10:29:17 AM
have you renamed your .htaccess.txt file  to just .htaccess    (leave the dot in the front,  only remove the .txt)

Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 19, 2016, 10:39:29 AM
Hi,

Yeah I've done that :) 

So, I put back a new htaccess, removed and readded the SSL cert on the box, cleared all caches, restarted devices and it finally work - all apart from Chrome but I think that's just a caching issue...  It was a weird one but it seems to now be working as it should :)

Thanks for the help everyone :D
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 19, 2016, 03:08:29 PM
Aaaaaaaannnnnnnddddd it's stopped working again :(

It really looks like I make a request to the webserver.  It services the HTTPS request and then it redirects the page back to HTTP again.   You can see, on Safari, the lock appear next to the site name then it refreshes the address bar and loads the none-https page...

Anyone?  I've literally done nothing other than activate Paypal Pro, turn off showing the postage estimates and changing some of the descriptions in my products...

If I go to the admin panel on my site and use https ://etc then it works just fine so it's something on the storefront.... Is there a config file that gets updated when you say to use SSL?  Perhaps that setting is getting corrupted or not set properly? 

Also, if I put the sit ein maintenance mode it connects to it with HTTPS just fine...
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 20, 2016, 03:58:31 AM
Hi!

Me again... I know I'm talking to myself :)

So.... It's now working again.... what did I do?  I went in to System and turned the logging options on , saved the page then reloaded the store... and it started working....  This makes me think it's just not writing "something" to a config files or that file is getting corrupted/overwritten by another part of the system and it happens that writing these settings has but things back... for now...

Anyone have any thoughts?  I seem to be able to "break it" again by turning off the Template Debugging option...
Title: Re: SSL/HTTPS automatic switching issue
Post by: abantecart on May 20, 2016, 07:53:32 AM
Config files or htaccess are not overridden by system.

If you set up HTTPS url into HTTPS setting in admin -> system, only customer, cart and checkout related pages will be using HTTPS

If you prefer ALL the pages to have HTTPS (not needed), set the main URL in settings to HTTPS. 
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 22, 2016, 05:59:24 AM
Hi,

Yes, this is the behaviour I am expecting but I keep getting this (see pic) where it says it's using HTTPS but it's not using the cert...


It also seems to work for a short while then I get back to this again....
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 22, 2016, 06:06:03 AM
OK, it's official, if I go in to Settings>System and save the page then SSL starts working again... for awhile...  Any ideas?  The only thing in my logs is:

Code: [Select]
Name
Info
9101::App Warning
Extension banner_manager overrides core template with blocks/banner_block/one_by_one_slider_banner_block.tpl in /home/zethwa/public_html/tranquili-tea.co.uk/core/engine/view.php on line 287
9101::App Warning
Extension banner_manager overrides core template with blocks/banner_block_content.tpl in /home/zethwa/public_html/tranquili-tea.co.uk/core/engine/view.php on line 287
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 27, 2016, 08:38:28 AM
Still no thoughts on this one?  Seems weird that simply going in, setting Template Debug On, then Off, then On again followed by saving the page, should get HTTPS to function again for a short while...  Anyone... or should I just backup the site, remove it totally, reinstall and restore the backup?
Title: Re: SSL/HTTPS automatic switching issue
Post by: Basara on May 27, 2016, 09:45:10 AM
Hi.

Do you have anything third-party connected to your domain or server, I mean CDN like Cloudflare, some internal additional server caching? Did you contact with your hosting support?
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 27, 2016, 12:57:10 PM
Hi,

No nothing inbetween.  i was going to setup Cloudflare at some point but not yet.  It literally just comes and goes... I can also browse the HTTPS sections of the site and it doesn't swap over to HTTPS.... It's like that whole mechanism is broken for me...


Thanks for any help everyone :D
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on May 31, 2016, 01:58:32 PM
OK this is still not working :(  Even if I ignore the fact that going to HTTPS://www.tranquili-tea.co.uk doesn't actualy give me a secure connection the site just isn't switching to HTTPS on the pages it should (Accounts/Registration/Cart etc).

So I can't force it to use HTTPS for the whole site and I can't leave it to swap over automatically....

Any other ideas?  I've just got the standard 1.2.6 install that I've updated to 1.2.7.  I have added the line I mentioned in an earlier post to htaccess but apart from that it's all pretty much stock...

If I go to the admin part of the site and user https:// before that then it connects and lets me use the admin portal no problems.  It literally seems to not like when the store loads-in...

Title: Re: SSL/HTTPS automatic switching issue
Post by: Basara on June 01, 2016, 01:16:38 AM
Hi.

Disable your .htaccess file, then clear your AbanteCart cache, clear your Browser cache and check again
Title: Re: SSL/HTTPS automatic switching issue
Post by: abantecart on June 01, 2016, 09:16:12 AM
Hi,

Yes, this is the behaviour I am expecting but I keep getting this (see pic) where it says it's using HTTPS but it's not using the cert...


It also seems to work for a short while then I get back to this again....

I think this is your webserver configuration issue, not Abantecart. If you do not see certificate shown in the browser with HTTPS URL, check your Apache virtual host setting for https (port 443)
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on June 01, 2016, 02:55:42 PM
I'll try these couple of things are let you guys know :)

Thanks.
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on June 02, 2016, 09:59:26 AM
Hi,

I have done the following:

Cleared the Cache - many, many times
Renamed my htaccess file, it's no longer in use
Had my provider check my server config multiple times over
Triple checked my settings in the Store software
It doesn't work.

IF I go to the backend/admin part it works under HTTPS.  If I go to HTTPS://www.tranquili-tea.co.uk/hjdhfkjhfdsf I get an error page but it's a HTTPS secure connection still (padlock/key whatever).
The only time HTTPS fails to do anything is if I connect to the store front....  https://www.tranquili-tea.co.uk does not give mea secure connection.  https://www.tranquili-tea.co.uk/index.php?rt=checkout/cart does not give me a secure connection.  So I can only assume it has to be something related to the cart software itself as anything else on the webserver seems Ok...

Any ideas?  If not is there a way for me to wipe my install and re-instate my current store on the fresh install?  I presume there's a backup/restore procedure that covers this one?   Starting to think a reinstall os the only solution here...

Thanks guys.
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on June 02, 2016, 10:18:38 AM
OK....

So I have cleared everything down cache wise, emptied the cache on my browser, recreated the htaccess, pointed the site directly to HTTPS://www.tranquilitea.co.uk and added the following to htaccess

Code: [Select]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

So far, it appear to be working.... I will update if it all falls through again :D
Title: Re: SSL/HTTPS automatic switching issue
Post by: Basara on June 03, 2016, 06:15:37 AM
Hi,

I had SSL/HTTPS working just fine for a few days.  My host moved me to a new server and since then I've had issues with the site automatically changing to HTTPS. 



Like I say this worked just fine for a few days then my web host managed to enter a duplicate SSL cert on my box which caused me issues.

Still looks like the problem is in your hosting configuration
Title: Re: SSL/HTTPS automatic switching issue
Post by: abolabo on June 03, 2016, 11:59:01 AM
please try to replace your public_html/core/init.php file with attached and let us know
Title: Re: SSL/HTTPS automatic switching issue
Post by: moosehound on June 06, 2016, 10:45:55 AM
Hi,

It's been 4 days since my last post and all seems fine still :)  I didn't need to replace that file in the end I just cleared everything out and started afresh and it seems to have stuck this time :D

Thanks for all the support guys, very much appreciated!
Title: Re: SSL/HTTPS automatic switching issue
Post by: orfei_ on December 22, 2016, 02:11:26 PM
Problem is in the 1.2.6 init.php file. I just upload init.php file from version 1.2.8 and SSL begin to work again for me...