You can choose one DAM to use relative paths on your site. This means that your DAM URLs may start with "/", instead of being fully qualified. A fully qualified URL is a complete Internet address and must include a hostname and top-level domain.
By default, all the URLs for assets on your DAM need to be fully qualified in order to preview them on CloudCannon. Similarly, CloudCannon will always save fully qualified URLs in your code when you upload an asset to a DAM through the CMS. This behaviour can be turned off by choosing to use relative paths for your DAM.
This option can be useful if your SSG prepends the DAM's base url during the build.
Using relative paths#
By default, relative paths in your site must refer to the site files.
If you choose to use relative paths with a DAM, you will not be able to browse assets from, or upload to, your site files in CloudCannon.
- In your site’s settings, navigate to Files/Assets
- Locate your DAM from the list, and click the three dots in the top right corner
- From the context menu, click Use Relative Paths
- Click the Confirm button
When changing this setting, you might need to rewrite existing URLs on the site to avoid broken previews in CloudCannon.
To undo this change, repeat the steps above but use the context menu on Site Files in the list.