We currently have a React Web app. We’d like to be able to add WordPress in a subdirectory of the application. So for example:
- The react app lives on https://examplesite.com
- We would like WordPress installed on https://examplesite.com/blog
Currently our app is containerized on AWS.
How would we go about doing this?
2
Answers
Updated: as @Brendan Bond suggest, you would need to setup a web server to serve the wordpress setup. You cannot just put the wordpress folder under a react app to make it work. However if you want to set up wordpress in a subfolder, you can follow the step below.
I would assume you know how to config the web server which serves wordpress. You would need to work through the following steps.
1 Take the official wordpress guide as the reference, config wordpress to work under the path:
https://wordpress.org/support/article/giving-wordpress-its-own-directory/
2 Config the web server which serves wordpress (e.g. apache2) and make sure https://examplesite.com/blog is pointing to your wordpress installation
3 Put the link (https://examplesite.com/blog) in your react app and test if you can visit the wordpress site properly.
The easiest way that worked for me: