You can use this document to learn how to integrate a custom website with StackPath services.
To use this document, you must already have a site created with CDN services enabled.
Before you begin, review the following differences between an origin URL and an edge address:
- An origin URL is a URL that points to the main server, such as http://yourdomain.com.
- An edge address is a URL automatically generated after a site is created in the StackPath Control Portal, such as http://site.company.stackpathdns.com.
- If a custom edge address is created with a CNAME record, then the edge address will look similar to http://cdn.yourdomain.com.
Configure your custom website
Access the source code of your custom website, and then point the static content to its corresponding CDN location. To accomplish this, replace the origin URL with the edge address.
This action will cause the location of the files on the CDN to mirror the location of the static content on the origin server. As a result, you will not need to edit the path.
- For example, for a file on the origin located at yourdomain.com/images/logos/big.jpg, its location on the CDN would be http://something.stackpathcdn.com/images/logos/big.jpg.
Review the following example to learn how to update the URLs in your source code:
Do not alter the URLs of pages and dynamic content because dynamic content will not cache correctly.