Setting up a custom asset domain enables you to serve assets to your visitors using your custom domain instead of the default Kontent.ai asset domain. The links on your webpage will look more trustworthy and have better SEO. Contact us to set up a custom asset domain.
Why use a custom domain?
The asset domain is the domain from which you serve assets such as images, videos, or PDF documents. The main benefits of having a custom domain for your asset links are higher credibility and better SEO:
When visitors open your asset in a new tab and see its URL in full, they'll see that it's associated with your company – unlike when it's served from Kontent.ai's default asset domain. This helps to avoid confusion and makes the links look more trustworthy and official.
Assets served from your own domain have better search engine optimization because they can be associated with your homepage.
Custom domains and SDKs
Custom asset domains are natively supported when using the Delivery JS SDK. With the JS SDK, you specify the assetsDomain configuration option and the SDK takes care of the rest.You can also use your custom domain with other SDKs or without any SDK. In this case, you need to replace the domain in the asset URLs in your app. For example, let’s say you want to use the custom domain assets.customer.com:
The Delivery API returns the absolute asset URL in this format: https://assets-us-01.kc-usercontent.com/ID1/ID2/kontent_ai.png.
You need to replace the domain part of that URL (that is assets-us-01.kc-usercontent.com) to get https://assets.customer.com/ID1/ID2/kontent_ai.png.
Set up a custom asset domain
One custom asset domain is available for every standard subscription. If you need more custom domains, you can purchase them additionally. To set up a custom domain, contact us using the button below so that we can start the activation process.The activation is not immediate and requires cooperation from your side. To successfully set up the custom domain, you’ll need to complete the steps below.
1. Choose your domain and select projects
Choose the custom domain you want. We recommend a subdomain of the domain you own. For example, if your domain is customer.com, a valid custom asset domain can be assets.customer.com or resources.customer.com.Select projects for which you want to use the custom domain. You can have multiple projects with one domain or use a separate domain for each project. You can also first test it with one project and have us set up more domains later.
2. Set up your DNS
Contact our support using the button in the bottom right and provide details of your desired setup. We'll then start with the configuration on our side. You'll need to pass the ACME DNS challenge to prove that you own the domain so that we can earn a certificate for serving your assets via HTTPS.For the challenge, we'll provide you with a CNAME configuration that you'll need to add to your DNS. You will need to keep this record in your DNS permanently for automatic re-verification.After the verification is complete, we'll send you another CNAME record that you'll need to add to your DNS. This one will point your custom asset domain to our servers. When you confirm that the CNAME record is in your DNS configuration, we'll set things up on our side.From this point on, you'll see your custom domain in asset details in Kontent.ai.
3. Update your SDK configuration
The last thing to do is to add the custom domain to your SDK configuration. When you're done, the assets you retrieve in your app will have URLs with the custom domain.In case you're not using an SDK, you need to implement replacing the domain in your asset URLs yourself.After this, the setup is done. Your assets now have your custom domain in their URLs.
Even with a custom domain in place, your assets are still accessible using the default asset domain. We can also set up redirects to your custom domain if you have the default asset URL hardcoded somewhere in your app.
Avoid environment swap with custom asset domainsA custom asset domain is tied to a specific environment, regardless of whether the environment is marked as production. This means you can’t use a custom asset domain with the environment swap. After each swap, it'd be necessary to set up new HTTPS certificates.
Custom asset domains can be set up only for the production environment.