[wp-trac] [WordPress Trac] #40886: REST API: PUT requests fail on Nginx servers when fancy permalinks aren't enabled

WordPress Trac noreply at wordpress.org
Tue Jul 25 00:53:49 UTC 2017


#40886: REST API: PUT requests fail on Nginx servers when fancy permalinks aren't
enabled
-------------------------------------------------+-------------------------
 Reporter:  Joen                                 |       Owner:  pento
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  4.8.1
Component:  REST API                             |     Version:  4.4
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests commit      |     Focuses:  rest-api
  fixed-major                                    |
-------------------------------------------------+-------------------------
Changes (by pento):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"41140"]:
 {{{
 #!CommitTicketReference repository="" revision="41140"
 REST API: Always add `index.php` to the REST URL when pretty permalinks
 are disabled.

 When pretty permalinks are disabled, the web server will internally
 forward requests to `index.php`. Unfortunately, nginx only forwards
 HTTP/1.0 methods: `PUT`, `PATCH`, and `DELETE` methods will return a 405
 error.

 To work around this nginx behaviour, including `index.php` in the REST URL
 skips the internal redirect.

 Merges 41139 to the 4.8 branch.
 Fixes #40886.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40886#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list