How to Use a CDN with WordPress

There are two main ways of working with a CDN. A Push Zone and a Pull Zone. A Push Zone is when you upload your files directly to your CDN provider (you push them) and it serves them. A Pull Zone is when your CDN mirrors your server, copying everything that’s on it and serving a copy (it pulls them in).

Apache: Rewrite to www

# Be aware that the following might not be a good idea if you use “real”
# subdomains for certain parts of your website.

<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>