cdn.site.com. Replace every cdn.site.com occurrence with that hostname, and replace every shop.example.com occurrence with the storefront hostname:
1
Open the CDN resource
In the Gcore Customer Portal, navigate to CDN > CDN resources and open the resource.
2
Copy the custom domain
Note the custom domain shown for the resource — this is the hostname to use in the X-Cart file edits. Do not use the Gcore target hostname (
cl-****.gcdn.co).3
Confirm the DNS CNAME
Confirm that the custom domain has a CNAME record pointing to the Gcore target hostname shown in the Customer Portal (
cl-****.gcdn.co).4
Confirm SSL
Confirm the custom domain has a valid SSL certificate so assets can load over HTTPS.
5
Test origin asset paths
Request a known skin file, image, and generated cache file directly from the configured origin. Use the same paths that X-Cart exposes for each file, and confirm that the responses contain the expected assets instead of
403 or 404 errors.smarty.php, then apply the remaining file edits.
1
Rewrite skin and image URLs
Open Replace those lines with one of the following blocks. Both options use HTTPS because the custom domain requires an active SSL certificate:
smarty.php in the X-Cart root directory. Find:- Use the dynamic skin path to keep the active
$smarty_skin_dirvalue:
- Use the fixed skin path to hardcode the
ideal_comfortskin. If the store uses a different skin, changeideal_comfortto that skin directory name:
2
Rewrite deferred cache URLs
Open Replace it with the following code. It preserves
/include/templater/plugins/function.load_defer_code.php. Find:$var_dirs_web['cache'], so the HTTPS URL follows the configured X-Cart cache path:3
Rewrite the file URL location
Open Immediately after that line, add:
/include/func/func.files.php. Find, but don’t replace:4
Rewrite category image URLs
Open Replace it with the following code, using the storefront hostname in place of
/include/templater/plugins/function.get_category_image_url.php. Find:shop.example.com:5
Rewrite banner image URLs
Open Replace it with:
/skin/common_files/modules/Banner_System/banner_rotator.tpl. Find:6
Clear X-Cart caches
Run the
cleanup.php utility from the X-Cart root URL to clear compiled Smarty templates. Clear the contents of var/cache through the store’s standard deployment process if generated application cache files remain, but retain the directory and its permissions.7
Confirm the integration
- Open the browser developer tools.
- Select the Network tab.
- Refresh the page.
- Confirm that static files load from the custom domain instead of the original domain.
Access-Control-Allow-Origin header. Set the header to the storefront origin, or to * only when unrestricted public font access is appropriate.