reactjs - 我们如何将 WordPress 添加到 React App 的子目录中?
问题描述
我们目前有一个 React Web 应用程序。我们希望能够在应用程序的子目录中添加 WordPress。例如:
- react 应用程序位于https://examplesite.com
- 我们希望在https://examplesite.com/blog上安装 WordPress
目前,我们的应用程序在 AWS 上进行了容器化。
我们将如何做这件事?
解决方案
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.
推荐阅读
- python - 如何使用 boto3 检索 S3 文件大小
- excel - VBA防止范围内单元格的文本溢出
- python - 执行 Python 脚本的 MySQL 触发器
- firebase - 如何访问 firebase Authentication 部分
- ios - 使用 iOS13 通过 NFC 读取 eID 信息时遇到问题
- python - Python计时器启动和重置
- excel - 如何删除 Excel 字符串中的所有空格?
- sql-server - 实体框架 6 和地理数据 STContains
- java - 如何将使用 java 制作的代码动画图形上传到 Wordpress?
- ssh - 如何获得无业游民的公钥?