0

I've followed a guide to set up CloudFront to use as a CDN on my Wordpress website. It was done using this guide.

Everything that WP Super Cache specifies is served by CloudFront however if a user goes to https://cdn.my-domain.com then the whole website is served. How do I stop this? I'd like just things in wp-content and wp-includes to be served.

I've tried reading all the documentation, but some of it isn't as clear as it could be. I've managed to set up an SSL certificate, however this is something I can't work out.

Thanks

CircularRecursion
  • 137
  • 1
  • 1
  • 7
  • 1
    You can set up path-based "behaviors" for a CloudFront distribution. Set the default behavior to serve out of an empty S3 bucket, and set your `wp-content` and `wp-includes` paths as non-default behaviors. Or, take the easy approach and just leave it as-is – ceejayoz Jan 19 '16 at 21:22

1 Answers1

0

From the FAQ

Cache Behaviors A cache behavior is the set of rules you configure for a given URL pattern based on file extensions, file names, or any portion of a URL path on your website (e.g., *.jpg). You can configure multiple cache behaviors for your web distribution. Amazon CloudFront will match incoming viewer requests with your list of URL patterns, and if there is a match, the service will honor the cache behavior you configure for that URL pattern. Each cache behavior can include the following Amazon CloudFront configuration values: origin server name, viewer connection protocol, minimum expiration period, query string parameters, cookies, and trusted signers for private content.

There's some useful information on this page that should show you how to configure it to only cache a given directory. Plus refer to the comment above which gives another option.

Tim
  • 31,888
  • 7
  • 52
  • 78