Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tip/gotcha to documentation explaining "plain permalinks" setting and API routes #87

Open
haszari opened this issue Mar 4, 2020 · 0 comments

Comments

@haszari
Copy link

haszari commented Mar 4, 2020

If a WordPress site has plain permalinks setting enabled, I believe this affects how you can call/access API routes (please correct me if I'm wrong).

This is the setting I'm referring to:

Screen Shot 2020-03-05 at 8 47 23 AM

When plain permalinks are enabled (the default setting), the curl examples in the docs don't work. For example:

curl http://localhost:8222/wp-json/wp/v2/posts
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache/2.4.38 (Debian) Server at localhost Port 8222</address>
</body></html>

(The examples work fine with any other permalink option enabed.)

I think there might be other gotchas when WordPress is installed in subfolder on the server. It would be great to add a section to the docs outlining these potential gotchas for new developers.

This section could also include recommendations for how to set up your WordPress install so the examples work out of the box. (Note that plain permalinks is the default setting in WordPress.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant