Bug 1 — api.php blocks /images/ paths
In api.php (generated by Sitejet on every publish), this line:
$isAllowedGet = $requestMethod === ‘GET’ && preg_match(‘#^/(form_container|collection|website)/#’, $url);
…only whitelists form_container, collection, and website as valid GET paths. The “images” path is missing. Any request to /api.php/images/… is rejected — api.php returns an empty response instead of proxying the image.
Fix: add |images to the regex:
$isAllowedGet = $requestMethod === ‘GET’ && preg_match(‘#^/(form_container|collection|website|images)/#’, $url);
Since api.php is overwritten on every Sitejet publish, this fix is lost each time. There is no permanent server-level workaround — we currently have to make api.php read-only to preserve the fix, which is not sustainable.
Bug 2 — Double /api.php/ prefix in image URLs
When a collection page loads, Sitejet’s JavaScript fetches collection data via /api.php/collection/… (correct). The API response includes image paths that already contain /api.php/images/… The JavaScript then prepends the api base URL again, resulting in:
/api.php/api.php/images/800x800/{fileId}/{filename}.jpg
Instead of the correct:
/api.php/images/800x800/{fileId}/{filename}.jpg
This is visible in the browser Network tab on any collection item page.
Why some images can be partially fixed and others cannot
Images that Sitejet has synced to the local /images/ directory can be served with a server-side .htaccess rewrite as a workaround. However, newer listing images that exist only in Sitejet’s cloud (not on the local server filesystem) return 404 at every local path (/images/0/, /images/800x800/, /images/1920/, etc.). These images must go through api.php to be proxied from the CDN. Since api.php blocks /images/ paths, these images are completely inaccessible and no server-side workaround can fix them.
Example page where cloud-only images are broken: Elementen 38 - Woningaanbod: overzicht - Greenfield Makelaardij | Makelaar & Bouwconsultancy Randstad (Media tab)
Steps to reproduce
- Set up a Sitejet website with a collection containing images (e.g. real estate listings)
- Publish to a Plesk server
- Open any collection item page and check the image/media tabs
- Open browser DevTools → Network tab → filter by “api.php”
- All image requests return 404
Requested fixes
- Add “images” to the allowed GET paths in api.php — this is a one-line change and resolves the proxy blocking permanently
- Fix the client-side URL construction so image paths from the collection API response are not prefixed with /api.php/ a second time
Both fixes are needed. Fix 1 is critical for images that only exist in Sitejet’s cloud. Fix 2 prevents the double-prefix issue that requires server-side rewrites as a workaround.