How can I serve images from my own custom domain?
π Note: For higher pricing plans (starting with Business 100K), you also get the ability to use your own custom domain name for the CDN-served images rather than an Optimole subdomain, something like images.yoursubdomain.com.
Here are the steps to set up a custom domain:
- 1
-
Go to the Custom Domain tab and add the custom domain you will want to use instead of your_key.optimole.com (eg. cdn.example.com). Please, make sure you use an existing domain/subdomain.
-
- 2
-
A certificate will be generated for the specified domain, and you will receive DNS Records to be added to your DNS Zone Editor for the domain configuration, ensuring certificate validation.
π Note: Take note that a certificate must be validated within 72 hours from the time it was generated, or else it will expire.
- 3
-
After the certificate is validated, modify your wp-config.php so that you specify the usage of the new custom domain.
define( 'OPTML_CUSTOM_DOMAIN', '<user custom domain>' );
π Note: The <user custom domain>
- 4
-
You can verify that the custom domain is serving the images you added by inspecting the image URL.
π Note: In the Images Domain (right panel of your WordPress Optimole dashboard page), you can observe that the name has been modified to match the custom domain you established.
If you encounter any issues at any of the steps mentioned before, you can let us know, and we will help you resolve any issues.
AWS Authorization
Depending on the hosting provider, you will have to allow AWS to validate certificates for you as specified here:
https://support.cloudflare.com/hc/en-us/articles/115000310832-Certification-Authority-Authorization-CAA-FAQ
Just add the following authorities for your domain:
example.com. CAA 0 issue "amazon.com"
example.com. CAA 0 issue "amazontrust.com"
example.com. CAA 0 issue "awstrust.com"
example.com. CAA 0 issue "amazonaws.com"
This should allow AWS to emit an SSL certificate for you and validate it.