frankenphp-wordpress icon indicating copy to clipboard operation
frankenphp-wordpress copied to clipboard

Wordpress /wp-json malfunction

Open manzu opened this issue 1 year ago • 3 comments

The Wordpress REST API under the uri path /wp-json doesn't work under FrankenPHP with the included Caddyfile. Because of this you can't use the Jetpack plugin and probably other things also. Another symptom of this is that Tools > Site Health reports problems.

Might be related to PHP 8.2 / Wordpress which is beta support still

Adding

               handle_path /wp-json/* {
                        uri strip_prefix /wp-json
                        rewrite index.php?rest_route={uri}
               }

to the Caddyfile helps in /wp-json/ now working but Site Health and Jetpack still fail

manzu avatar Mar 26 '23 20:03 manzu

With this solution I think we may need to pass the Authorization header with a module like https://caddyserver.com/docs/modules/http.handlers.authp

manzu avatar Mar 27 '23 18:03 manzu

disregard my last comment. the Cookie headers containing authorization are being sent.

also the handle_path directive is not needed

manzu avatar Apr 03 '23 05:04 manzu

@manzu Are you still having this issue? I can't reproduce it with the current version of this repository and WordPress 6.4.3.

staudenmeir avatar Feb 01 '24 17:02 staudenmeir