Skip to content

Commit d69d4ca

Browse files
authored
Added info for accessing REST API when using default permalinks
Added info for accessing REST API when using default permalinks (query params) or people get 404 errors with `/wp-json/` routes
1 parent 98608c4 commit d69d4ca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ Each of these concepts play a crucial role in using and understanding the WordPr
3333

3434
A route, in the context of the WordPress REST API, is a URI which can be mapped to different HTTP methods. The mapping of an individual HTTP method to a route is known as an "endpoint". To clarify: If we make a `GET` request to `http://oursite.com/wp-json/`, we will get a JSON response showing us what routes are available, and within each route, what endpoints are available. `/wp-json/` is a route itself and when a `GET` request is made it matches to the endpoint that displays what is known as the index for the WordPress REST API. We will learn how to register our own routes and endpoints in the following sections.
3535

36+
If you get a `404` error when trying to access `http://oursite.com/wp-json/` URL you may try fixing your pretty permalinks. If you are using default permalinks (query params) you can access the API at `?rest_route=/`, for example `http://oursite.com/?rest_route=/`.
37+
3638

3739
### Requests
3840

0 commit comments

Comments
 (0)