CDN Rewriting
Rewrite static asset URLs to serve from your CDN. Configurable directories, exclusions, and file types.
Last updated Feb 21, 2026
Overview
A Content Delivery Network (CDN) serves your static assets from edge servers distributed around the world, reducing latency for visitors far from your origin server. BoostPro's CDN integration rewrites static asset URLs to serve from your CDN pull zone.
This setting is located on the BoostPro → Optimization tab, under the CDN section.
Configuration
CDN URL
Enter your CDN pull zone URL (e.g., https://cdn.example.com). This is the URL provided by your CDN provider that maps back to your origin server.
Included directories
A comma-separated list of directories to rewrite. Only assets within these directories will be served from the CDN. The default value is:
wp-content,wp-includesExclusion patterns
A comma-separated list of URL substrings to exclude from CDN rewriting. Any URL containing one of these patterns will continue to load from your origin server.
.php,admin-ajaxSupported file types
BoostPro rewrites URLs for the following static file types:
| Category | Extensions |
|---|---|
| Images | jpg, jpeg, png, gif, webp, avif, svg, ico, bmp |
| Stylesheets | css |
| Scripts | js |
| Fonts | woff, woff2, ttf, eot, otf |
| Media | mp4, mp3, ogg, ogv, webm, flv |
| Documents | pdf, doc, docx |
How it works
BoostPro hooks into the boost_process_html filter (output buffer) and uses a regex to find static asset URLs matching the supported file types within the included directories. It replaces your site URL with the CDN URL while respecting exclusion patterns.
The rewriting handles absolute URLs, relative URLs, and protocol-relative URLs.
Setting up a CDN
If you don't already have a CDN configured, follow these steps:
- Choose a pull-zone CDN provider (Cloudflare, BunnyCDN, KeyCDN, StackPath, or similar)
- Configure the pull zone with your site's origin URL as the source
- Enter the CDN URL in BoostPro's CDN settings
- Set directories and exclusions as needed for your setup
- Test that assets load by inspecting network requests in your browser's developer tools
Tip
If you're already using Cloudflare as a reverse proxy (orange cloud enabled), you may not need CDN URL rewriting since Cloudflare already caches and serves static assets from its edge network.
Important
Make sure your CDN pull zone is configured and working before enabling CDN rewriting. An incorrect CDN URL will cause broken images, styles, and scripts across your site.