I'm building an Angular website which will also have a small WordPress installation for the marketing/sales team (to build landing pages). our marketing team is adamant that subdomains are bad for SEO, and for GA, and would like the WordPress installation to be in a subdirectory. ex:
example.com/ <-- Angular
example.com/marketing/ <-- WordPress
Angular is installed on an S3 bucket, WordPress is installed on an EC2 (behind a load balancer), and the whole thing is hidden behind a Cloudfront distribution! almost everything is working for me at this point:
example.com/marketing/ DOES correctly load up the WordPress site, and
example.com/ DOES load Angular (and
example.com/some-random-path correctly invokes the
/index.html Angular front-controller). the problem I'm having is that
example.com/marketing/some-random-path ALSO invokes the
/index.html Angular front-controller, since
example.com/marketing/some-random-path 404s. but for WordPress to work, 404s within
/marketing/ need to instead hit the
/marketing/index.php WordPress front-controller.
I looked into Amazon's lambda functions, but I wasn't sure how to get that working properly in combination with the WordPress
.htaccess. maybe the solution to all my problems lie there?
or maybe there's another way to configure this "fake"
/marketing/ subdirectory. is it a requirement and/or best-practice that it be wrapped up behind Cloudfront? none of our other WordPress sites are.
maybe there's some super-sneaky DNS thing I can do that I'm not aware of?
I'm open to alternative configurations; the one I've described is simply the one I've managed to figure out thus far.
one more note, if it's relevant: our domain names are registered with a third-party registrar (dnsmadeeasy), and not Amazon; dnsmadeeasy has (slightly?) faster DNS resolution, which other people working here are not keen to give up. I'm not sure it's relevant for this problem, but it has made configuration slightly more troublesome for me, so on the off chance that could be relevant, I thought I'd mention it.