Dipu R
Dipu R

Reputation: 575

Is it possible to host Wordpress Blog under route of React App

Is that possible to host a Wordpress Blog under a route in my React Web App?

For example, my React App is running on domain www.myreactapp.com, can I host a Wordpress blog under route www.myreactapp.com/blog.

When I worked with PHP Web APP, it was easy, you just need to create sub-folder named "blog" and install Wordpress in it. I am hoping to get a solution like in PHP Apps, if yes I can just make use of all features of Wordpress with less amount of coding.

Thanks in advance

Upvotes: 4

Views: 1498

Answers (2)

Dipu R
Dipu R

Reputation: 575

All,

We can host the Wordpress blog along with React App like in the question(for example www.myreactapp.com/blog).

Steps

  1. Use Nginx to host the React App

  2. Install Wordpress

  3. Add a rule in Nginx to proxy the request to WordPress when the request comes to /blog. http://nginx.org/en/docs/http/ngx_http_proxy_module.html

Hope this helps

Thank you

Upvotes: 1

Tushar Nikam
Tushar Nikam

Reputation: 624

You cannot do it directly as WordPress have its own configuration which is necessary for WordPress website due to which admin panel will not work, but you can use WordPress API to load the data you wanted from WordPress and show in react app.

I am not sure this is exactly what you wanted or not but you can also setup the WordPress separately in sub domain like http://blog.myreactapp.com

Also let me know if you found any working solution

Upvotes: 1

Related Questions