1

0

I am pretty new in website and server stuff and i have a question:

I have an react app and it should be the main and only website I want to reach under www.example.com, and I want to use Wordpress just headless (wp db and wordpress REST API) but on the same server. Server is managed by Plesk.

As far as I understood, Wordpress has to be installed in my servers document root, e.g. /httpdocs/.

But when I want to reach my react app under www.example.com, I have to deploy the build folder content also into /httpdocs/, which interfers with wordpress. In this case if I go to www.example.com, I get the wordpress site.

When I have my react app in another folder, e.g. /github/build/, and set this folder my document root, the page is accessible under www.example.com, but wordpress is not reachable anymore (www.example.com/wp-login.php not found).

The only ugly way it seems for me it can work is if I deploy the build folder into the wordpress root directory, but then the react app is only acessible under www.example.com/build (only guessing).

Is there a way to make it work as wanted?

2
  • 1
    You could just put WordPress in a subdirectory. If you're running it headless you don't necessarily need it in the root. So you could have it at example.com/wp or example.com/api or something. May 28, 2019 at 6:51
  • Many thanks. I will go for that solution.
    – flo
    May 28, 2019 at 18:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.