[wp-trac] [WordPress Trac] #42877: Rest routes 404ing when setting permalink to default

WordPress Trac noreply at wordpress.org
Tue Dec 12 13:00:10 UTC 2017


#42877: Rest routes 404ing when setting permalink to default
--------------------------+-----------------------------
 Reporter:  neesu         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  REST API      |    Version:  4.9.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hi Team,

 I have registered custom routes and endpoints using register_rest_route()
 method. The routes are working fine with all permalink settings except
 default permalink.

 I have changed the rest url prefix to my own. So for example lets consider
 one of my routes here i.e
 http://example.com/neo/v0/users

 So, neo is replacement of wp-json.
     v0 is namespace.
     /users is endpoint.

 As explained, it is working fine with all permalink settings except
 default. To get this working, I have to add query string rest_route to the
 url.

 i.e : http://example.com/?rest_route=/v0/users. But its not solution, when
 the route is using by any third party.

 The third party would not change the hitting routes according to the
 WordPress permalink settings.

 It would be appreciated for any help.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42877>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list