I have an existing static web-app on S3 behind CloudFront, let's say at example.com
I want to add a WordPress blog, which should be accessed at example.com/blog
For the WordPress blog, i've set up an ec2 server with Apache and WordPress.
I've added the ec2 server as origin in CloudFront as describe here.
When i'm running:
curl example.com/blog
i'm getting:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://ec2-x-x-x-x.us-west-1.compute.amazonaws.com/blog/">here</a>.</p>
<hr>
<address>Apache/2.4.18 (Ubuntu) Server at http://ec2-x-x-x-x.us-west-1.compute.amazonaws.com Port 80</address>
</body></html>
For that reason, I think my problem is not in CloudFront but in the configuration of the Apache server.
My question is: how to configure Apache to work this way?
meaning as sub-directory