PrestaShop behind Cloudflare

Add a Cloudflare exception for Unifunl when Cloudflare stops the connection to your PrestaShop store.

Unifunl talks to your store through the PrestaShop Webservice, at your shop's address followed by /api. When your site is behind Cloudflare, Cloudflare may answer those requests itself, with a browser check ("Just a moment...") or a block page, so they never reach PrestaShop and the connection fails.

The fix is one Cloudflare rule that lets Unifunl through and nothing else. It matches only requests to your Webservice that carry your own Webservice key, so the rest of your site keeps all its protection.

Get your rule

You do not write the rule yourself.

  1. In Unifunl, open Settings, then Integrations, and click Connect on the PrestaShop card.
  2. Fill in your store URL and your Webservice key, then click Connect Store.
  3. If Cloudflare stops the connection, the dialog shows Cloudflare is blocking Unifunl with your rule, built from the key you typed. Click Copy rule.

The rule contains a long value after Basic: that is your Webservice key, encoded the way it travels to your store. Paste the rule as it is. If you change the key in the form, the rule changes with it.

Add the rule in Cloudflare

  1. In Cloudflare, open your site, go to Security, then Security rules, and select Create rule, then Custom rules. On the older dashboard, the page is Security, then WAF, then Custom rules.
  2. Name the rule Unifunl. Next to Expression Preview, select Edit expression and paste the rule you copied.
  3. Under Then take action, choose Skip and tick:
    • All remaining custom rules, All rate limiting rules, All managed rules and All Super Bot Fight Mode rules;
    • and these products: Zone Lockdown, User Agent Blocking, Browser Integrity Check, Hotlink Protection and Security Level.
  4. Select Deploy, then drag the Unifunl rule to the top of the list. Cloudflare runs custom rules in order, so a rule above it could still stop us.
  5. Come back to Unifunl and click Connect Store again.

Bot Fight Mode and "I'm Under Attack" mode

  • Free plan: Bot Fight Mode cannot be skipped by any rule. If it is on, turn it off under Security, then Settings, filtered by Bot traffic.
  • Pro plan and above: Super Bot Fight Mode is skipped by the rule above, because it ticks All Super Bot Fight Mode rules. If the older Bot Fight Mode switch is still on, turn it off as on the Free plan.
  • "I'm Under Attack" mode: if it is on, turn it off. Nothing in Cloudflare's documentation says a rule lets requests through it.

FAQ and troubleshooting

The dialog still says Cloudflare is blocking Unifunl

  • Check that the rule is at the top of the custom rules list, and that it is deployed, not saved as a draft.
  • Check that the key in the form is the key you created the rule with. The rule only matches that key.
  • The dialog shows a Ray ID. Search for it in Cloudflare's security events: the event names the feature that stopped the request.

Is my store less protected?

No. The rule only matches requests to your Webservice path that carry your Webservice key, which only Unifunl and you have. Every other visitor, on /api and on the rest of your site, still goes through all your Cloudflare protection.

I created a new Webservice key

Connect again with the new key: the dialog builds a new rule for it. Replace the expression of the Unifunl rule in Cloudflare with the new one.

Still blocked?

Contact our support at support.unifunl.io and we will get back to you right away.

Was this article helpful?

Share this article

Channels & integrations

Store integrations

The full catalogue of supported e-commerce platforms, what each one syncs, and what you need to connect it.

Channels & integrations

PrestaShop instant updates

Install the Unifunl module so product, stock and order changes in PrestaShop reach Unifunl in seconds.