Skip to content

PrestaShop SSL: how to enable HTTPS across the whole shop

· The AYT team · 5 min read

Woman in sunglasses holding many shopping bags

To enable SSL in PrestaShop, first install a certificate on the domain and check that the shop opens on https://. Then, in the back office, go to Shop Parameters → General and set both "Enable SSL" and "Enable SSL on all pages" to Yes. The order matters: if you switch SSL on without a valid certificate, the browser shows an error and you can lose access to the admin panel.

Before you start: the certificate

PrestaShop doesn't issue certificates, it only uses one. Your host installs it, usually a free Let's Encrypt certificate that renews automatically. It has to cover:

  • the shop's domain (shop.com);
  • the www version (www.shop.com), if you use it or it gets traffic.

Open https://shop.com in your browser. If you see the padlock and the shop loads (even with missing images or mixed content warnings), carry on. If you see "Your connection is not private" or "NET::ERR_CERT_COMMON_NAME_INVALID", stop: the certificate is missing or issued for another name. More on padlocks and certificates in the HTTPS and SSL guide.

Back up the database too. The SSL settings are stored there, and a recent backup takes the stress out of a mistake.

Step 1: turn on "Enable SSL"

  1. Log in to the back office and open Shop Parameters → General.
  2. Next to "Enable SSL", PrestaShop shows a link that checks whether the shop answers on HTTPS. Click it.
  3. The page reloads on https:// and the selector becomes active. Choose Yes.
  4. Click Save.

At this point PrestaShop uses HTTPS for the customer account and checkout, the pages with personal data.

Step 2: turn on "Enable SSL on all pages"

The option appears only once "Enable SSL" is on. Set it to Yes and save. From now on every link PrestaShop generates (categories, products, images, CSS, JavaScript) starts with https://.

In the database, the two settings are PS_SSL_ENABLED and PS_SSL_ENABLED_EVERYWHERE in the ps_configuration table. You'll need those names below if something goes wrong.

Step 3: redirect HTTP to HTTPS

The PrestaShop setting changes the links, but the old http:// addresses live on in Google, in ads and in emails you've sent. Add a 301 redirect from http:// to https:// on the server, so every old address lands on the secure version:

  • on Apache, with rules in .htaccess;
  • on nginx, with a server block that answers with return 301.
server {
    listen 80;
    server_name shop.com www.shop.com;
    return 301 https://shop.com$request_uri;
}

nginx doesn't read .htaccess at all, so rules there have no effect. More in the article about .htaccess on nginx.

Step 4: clean up mixed content

Mixed content means an HTTPS page loading resources over http://: an image in a product description, a banner from a module, an external script. The browser blocks the scripts and may hide the padlock.

Where it shows up most often in PrestaShop:

  • product descriptions and CMS pages where you pasted images with a full http://shop.com/img/... address;
  • slider or banner modules that saved the image URL with http://;
  • old themes loading fonts or scripts explicitly over http://.

To find them, open the page in Chrome, press F12 and look for "Mixed Content" in the Console tab. Each message gives you the exact address.

For text stored in the database, a search and replace of http://shop.com → https://shop.com fixes everything in one go. Back up first, and replace only your own domain's address, not every http://.

Step 5: clear the cache and check

  1. Clear the cache from Advanced Parameters → Performance → Clear cache (see also clearing the PrestaShop cache).
  2. Open the home page, a category, a product, the cart and checkout. Check the padlock on each.
  3. Regenerate the sitemap so it lists https:// addresses.
  4. In Google Search Console, add the HTTPS property if you don't already use a domain property, and submit the new sitemap.

How to disable SSL in PrestaShop when you can't get into admin

If you turned SSL on before a valid certificate existed, the back office may become unreachable. Fix it in the database:

  1. Open phpMyAdmin and select the shop's database.
  2. Run this (replace ps_ with your prefix if it differs):
UPDATE ps_configuration SET value = '0'
WHERE name IN ('PS_SSL_ENABLED', 'PS_SSL_ENABLED_EVERYWHERE');
  1. Empty the var/cache/prod folder (PrestaShop 1.7.4 and later) so the new value is read.
  2. Log in to admin over http://, sort out the certificate, then repeat the steps above.

For other lockouts after a change, debug mode shows you the exact error.

Frequently asked questions

I get ERR_TOO_MANY_REDIRECTS after enabling SSL. Why?

Most often it's Cloudflare set to "Flexible": Cloudflare talks to your server over HTTP, the server redirects to HTTPS, and the loop repeats. Set Cloudflare's SSL mode to "Full (strict)". The second cause is two redirects that contradict each other (one to www, one to the bare domain).

Will I lose Google rankings when I switch to HTTPS?

With a 301 redirect on every address, Google moves its index to the new URLs. What hurts rankings is missing redirects or long redirect chains.

HTTPS for PrestaShop on AYT

The SSL/TLS Status page in the AYT panel

On AYT, the Let's Encrypt certificate is issued and renewed automatically, for the domain and for www., mail. and webmail.; you can also upload your own certificate. You see its state on the SSL/TLS Status page. Once the domain has a certificate, nginx sends http:// addresses to https:// with a 301 redirect by default, so step 3 is already done. In the PrestaShop Toolkit, the Security page has a "Use HTTPS in the app" item that turns on SSL for every page of the shop, and the Search & replace page swaps old addresses in the database. Plans are on the hosting page.

More articles

All articles