Headless WP theme with NextJS

20 Views Asked by At

I am trying to convert my WP theme to a headless version using NextJS. I came to the point where was I able to generate my out directory with the proper content from the WP database using graphQL.

Next, I would like to understand if and how it is possible to run the out files within a WP theme. I am trying to avoid having to run 2 separate services/servers, one for WP back-end and another for the static files of the front-end.

My initial idea was to edit the .access file to redirect any access to the WP slugs to the equivalent .html files inside 'out', but none of the formulas I tried worked.

I wonder if my approach above is recommended and if anyone could help with the .htaccess rules.

Any other suggestions are also appreciated.

Trying to run both the backend and frontend of WP inside a single theme.

0

There are 0 best solutions below