WordPress.org

Make WordPress Core

#42869 closed enhancement (wontfix)

Rest URL home vs. site

Reported by: dennishh Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.4
Component: REST API Keywords:
Focuses: Cc:

Description

We're having the issue that the REST API is only available via the home url, not the site url.
Unlike many other Wordpress users, we only use it as a headless CMS - the page hosted under home url is not a Wordpress, but a custom-built application. It doesn't know anything about the Wordpress API (and it should not!).
I know that this issue was rejected in https://core.trac.wordpress.org/ticket/37020, so I'm asking to either
a) add the possibility to configure the host for the API endoint or
b) give me some information on how to customize the REST API host via a plugin

Thanks in advance!

Change History (2)

#1 @rachelbaker
22 months ago

  • Component changed from HTTP API to REST API
  • Milestone Awaiting Review deleted
  • Version changed from trunk to 4.4

@dennishh You can use the rest_url filter to customize the returned value of the get_rest_url() function.

https://developer.wordpress.org/reference/hooks/rest_url/
https://developer.wordpress.org/reference/functions/get_rest_url/

#2 @rachelbaker
22 months ago

  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.