Hosting a WordPress blog as a sub folder from a S3 website

You are using Cloudfront in front of S3, so in order to mix in 2 sources of content you need to

  1. on your blog.mycompany.com – add rewrites of blog/* -> /* so that your blog can handle blog.mycompany.com/blog/ urls well.

  2. add new blog.mycompany.com as an Origin in “Origins and Origin Groups” tab.

  3. add new “Behavior” for /blog* path pattern and point it to your newly created “blog.mycompany.com” origin.

  4. if you get redirects from blog (e.g. WPMU can do that) – hack $_SERVER hostname variable in your wp-config.php and replace it

Leave a Comment