Magento - onePage checkout and SSL (HTTPS)

12,102

Solution 1

Write in .htaccess rewrite

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

or Magento admin

Solution 2

Magento has in built functionality to use https for my account pages , login page and checkout pages. you just need to set the secure base url in Admin->configuration->General->Web->Secure and provide path with https.

Thanks

Share:
12,102
Some one else
Author by

Some one else

Updated on June 04, 2022

Comments

  • Some one else
    Some one else almost 2 years

    Need a magento shark to help me out here:

    I have a problem with the onepage checkout, I set it up to run https. (changed the link leading to the page to https://mydomain.com/checkout/onepage/

    Worked fine, except magento still prints all of the links one the checkout as http and tries to load via ajax and http. This of cause fails since you cannot do a http/ajax request through a https connection. So I thought to myself lets try to hack it. I made a quick document.ready function and replaces all instances off http with https, actually worked like a charm until the Order review. Here when I click continue, it fails. With the expected "X-JSON call to unsafe bla bla bla" meaning it somewhere calls an unsafe url.

    My question: - Is there someway to tell magento to run the onepage checkout in https (already setup the https stuff in the backend.) - if not (I'm no JSON ninja more of a jQuery dude myself) does anyone have any idea how to hack the magento json scripts into running https. I tracked the problem down to the call to "http://mydomain.com/checkout/onepage/saveOrder/" and this onclick function "review.save()"

    any pointers help would be GREATLY appreciated :)