Klaviyo is a service used across multiple Magento sites. Unfortunately, they integrate with Magento by forcing index.php before the path. Ultimately this is incorrect, however request for this to be changed have been ignored or unanswered. Fortunately if you are using Cloudflare there is a relatively simple way around this.
- Log into Cloudflare, go to your domain and select "Rules"
- Create a new rule
Name: Support index.php in rest urls (Klaviyo)
If: Wildcard pattern
Request URL: https://www.example.co.uk/index.php/rest/*
Then: https://www.example.co.uk/rest/${1}
Preserve Query: Yes - Save and apply the rule
- Give the rule ~5mins to apply
- Retry your Klaviyo connection