> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-doc-1894.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate a CDN resource with Joomla

[CDN for Joomla!](https://regularlabs.com/cdnforjoomla) rewrites selected media URLs so a pull CDN can cache and deliver Joomla files without moving them from the origin. The current extension supports Joomla v4–v6 and requires PHP 8.2 or later.

<Info>
  Administrator access to Joomla, CDN for Joomla! Pro, an active CDN resource, and an HTTPS-enabled [custom domain](/cdn/cdn-resource-options/general/create-and-set-a-custom-domain-for-the-content-delivery-via-cdn) are required. The Pro extension is required to rewrite HTTPS URLs.
</Info>

Back up the Joomla files and database before installing the extension.

<Steps>
  <Step title="Prepare the CDN resource">
    Configure the Joomla hostname — `www.example.com` — as the CDN origin. Set the origin host header to the same hostname when the web server uses name-based virtual hosting.

    Activate `cdn.example.com` as the HTTPS custom domain and confirm that a known media path returns successfully through both the origin and CDN domains.
  </Step>

  <Step title="Download CDN for Joomla! Pro">
    From the Regular Labs [download page](https://regularlabs.com/cdnforjoomla/download), download the Pro installation package for the installed Joomla version. Keep the package as a ZIP file.
  </Step>

  <Step title="Install the extension">
    In the Joomla administrator, navigate to **System** > **Install** > **Extensions** and open the **Upload Package File** tab.

    Drag the ZIP package into the upload area or select **Browse for File**. Joomla uploads and installs the package automatically.
  </Step>

  <Step title="Open the system plugin">
    Navigate to **System** > **Manage** > **Plugins**, search for `System - Regular Labs CDN for Joomla!`, and open the plugin.

    Set **Status** to **Enabled** if the plugin is not already enabled.
  </Step>

  <Step title="Configure the CDN settings">
    On the **Setup** tab, configure the following fields:

    * **CDN Domain**: Enter `cdn.example.com`.

    * **CDN Protocol**: Select **HTTPS**.

    * **Site Root**: Keep the default value when the CDN origin exposes the Joomla root. For an origin restricted to the `/images/` subfolder, enter `/images/`.

    * **File Types**: Include only the media types that the CDN should deliver.

    * **Ignore Files**: Add any files that must remain on the origin.

    Click **Save & Close**.
  </Step>

  <Step title="Verify CDN delivery">
    Open a Joomla page that contains a configured media type and use the browser developer tools:

    1. Open the **Network** panel.

    2. Reload the page.

    3. Select an affected image, stylesheet, script, or other configured file.

    4. Confirm that the request URL uses `cdn.example.com` and returns a successful response.
  </Step>
</Steps>

## Integration troubleshooting

When rewritten media fails to load from the CDN domain, the cause is usually an ignored file, a CORS restriction, a path mismatch, or an origin error.

* If a script fails after URL rewriting, add its path or filename to **Ignore Files**.
* If a font request is blocked by the browser, configure the origin to return an `Access-Control-Allow-Origin` header for `https://cdn.example.com`.
* For a `404` response, compare **Site Root** with the CDN origin path.
* For a `502` response, verify the origin pull protocol and host header in the CDN resource.
* If only some media uses the CDN domain, review **File Types** and **Ignore Files**.
