Kentico ImageEngine Integration

Sign up for an ImageEngine account and configure the account with an origin and a domain name. You may also use the canonical ImageEngine domain name.

Below, we assume that is configured by DNS to serve ImageEngine traffic.

In your web.config file within <system.webServer> add the following:

        <rule name="Rewrite Media to CDN" preCondition="IsHTML">
            <match filterByTags="Img" pattern="/getmedia/(.*)" />
            <action type="Rewrite" value="{R:1}" />
        <rule name="Rewrite Media Files to CDN by path" preCondition="IsHTML">
            <match filterByTags="Img" pattern="/media/(.*)" />
            <action type="Rewrite" value="{R:1}"/>

Make sure to change in both places in the code above

For more information on IIS rewrites and configuration examples, see the IIS Rewrite module documentation.

# CSS Background Images

If you are using background images in your CSS, you will need to use the absolute path with the CNAME domain in order for it to properly optimize.

There are also plugins in the marketplace that enable this functionality, but they do not always support the latest version of Kentico: