A client has an Element API endpoint set up to return quick "as you type" search results. This works beautifully from the Craft site (https://example.com).
The client also has a subdomain powered by HubSpot (https://learn.example.com), and they want the same functionality across both sites. But when I copy over the same exact JS, the returned response is supposedly a 404, even though the JSON payload is identical.
Any ideas on why it's not working from a subdomain? I do have Access-Control-Allow-Origin defined properly, and I do see the difference it makes when it's there vs not there...
Description
A client has an Element API endpoint set up to return quick "as you type" search results. This works beautifully from the Craft site (
https://example.com
).The client also has a subdomain powered by HubSpot (
https://learn.example.com
), and they want the same functionality across both sites. But when I copy over the same exact JS, the returned response is supposedly a 404, even though the JSON payload is identical.Any ideas on why it's not working from a subdomain? I do have
Access-Control-Allow-Origin
defined properly, and I do see the difference it makes when it's there vs not there...element-api.php
JS search functionality (on the HubSpot subdomain site):
"404" response from Hubspot site:
Valid response from the Craft site:
Additional info