Skip to content

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

Description

@haszari

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.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions