[SalesForce] Visualforce site working on HTTP but not on HTTPS

I am facing a problem in making my visualforce page work on force.com(sites).

  1. Created a new visualforce page and it works fine when I click on
    preview button.
  2. Added the page to site.com and granted access to the user by clicking on the public access settings button on the site.
  3. When user logs into site(HTTPS protocol) and navigates to the Visualforce page created above it shows the error message saying "An error occured while loading the visualforce page". If I change https to http in the url it is working fine.

Question: so how do I make my visualforce work on HTTPS protocol on the site that I am adding to?? Please help me.

Below are relevant screenshots on what I am talking about:

Visualforce page:

enter image description here

Sites:

enter image description here

Site settings:

enter image description here

Site login settings:

enter image description here

Best Answer

We have found some session issues when switching back and forth from http and https. So I suggest go all the way either way.

  1. Force https:
    • Check Require Secure Connections (HTTPS) on the Sites settings. enter image description here
    • Uncheck Require Non-Secure Connections (HTTP) on the Sites > Login Settings. enter image description here
  2. Remove all HTTPS:
    • Uncheck Require Secure Connections (HTTPS) on the Sites settings.
    • Check Require Non-Secure Connections (HTTP) on the Sites > Login Settings.
Related Topic