These instructions apply to TYPO3 13 with Replacer 4.x and TYPO3 14 with Replacer 5.x. Replacer 5.x supports TYPO3 14 only. Back up the project files and database before installing the extension or changing TypoScript.
1
Prepare the CDN resource
In the Gcore Customer Portal, create a CDN resource with the TYPO3 site as its origin.Add a custom domain —
cdn.example.com — and enable HTTPS. Confirm that the CDN domain can retrieve representative files from /_assets/, /fileadmin/, and /typo3temp/assets/ when those directories exist.2
Install the Replacer extension
For a Composer-based installation, require Replacer 4.x on TYPO3 13 or Replacer 5.x on TYPO3 14.TYPO3 13:TYPO3 14:For a non-Composer installation, sign in to the TYPO3 backend as an administrator, open Extensions, search for
replacer, and install Replacer 4.x on TYPO3 13 or Replacer 5.x on TYPO3 14.3
Add the CDN replacement rules
Add the following TypoScript to The expression rewrites only the listed public asset directories in generated HTML.
setup.typoscript in the site configuration directory — the file next to config.yaml — or to setup.typoscript in the active site-package set. A root TypoScript template record is the legacy alternative and is applied after site TypoScript.4
Flush the TYPO3 caches
In a Composer-based installation, run:Alternatively, use the cache menu in the TYPO3 backend to flush all caches available to the administrator account.
5
Verify CDN delivery
Open the site in a private browser window. Open the browser developer tools, select Network, and reload the page.Filter requests by
cdn.example.com. Confirm that the targeted asset paths use the CDN hostname and return successful HTTP responses. Also inspect the generated HTML to confirm that page links and form actions still use the site hostname.Troubleshooting
When rewritten assets fail to load from the CDN hostname, the cause is usually a missing origin path, an origin connectivity error, a CORS restriction on the CDN response, a Content Security Policy that omits the CDN hostname, inactive TypoScript, or a search expression that matches an already rewritten URL.- For a
404response, confirm that the requested public path exists on the origin and that the regular expression preserves the full path. - For a
502response, check the origin hostname, pull protocol, port, and host header in the CDN resource. - If fonts or scripts are blocked by CORS, configure the origin or CDN so the asset response includes an
Access-Control-Allow-Originheader. - If the browser reports a Content Security Policy violation, add
cdn.example.comto the site CSP directives that apply to scripts, styles, fonts, or images. - If asset URLs do not change, confirm that the Replacer TypoScript is active on the page, and then flush the TYPO3 and CDN caches.
- If a URL contains the CDN hostname twice, narrow the search expression so it matches only local paths that begin with a quotation mark and an optional slash.