• Resolved Mark Wilkinson

    (@wpmarkuk)


    Hi there, I have a WordPress install where WordPress is installed in a folder named /cms and there is a custom content folder in the root named /content.

    On the settings screen I then leave the WordPress Address (URL) setting to domain.com/cms and set the Site Address (URL) to domain.com/ so that the CMS part is not in the address.

    It would appear that this is preventing the calls to the REST API from working. For example if I do a get request to this URL I get a 404.

    https://domain.com/cms/wp-json/wp/v2/posts

    However if I make both the WordPress address (URL) and the Site Address (URL) the same like this:

    https://domain.com/cms

    It works fine like above. Is this normal or a bug?

    https://www.ads-software.com/plugins/rest-api/

Viewing 2 replies - 1 through 2 (of 2 total)
  • John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Does the request work without /cms in the path? What’s the value of the <link rel='https://api.w.org/'> tag in the header of the home page?

    Thread Starter Mark Wilkinson

    (@wpmarkuk)

    Thanks for that John. The link rel on the homepage is set to domain.com/wp-json. Also I have tried without the cms and it works! How to look a fool quickly ??

    Therefore this link works in this setup:

    https://domain.com/wp-json/wp/v2/posts

    Thanks for your time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘404 When WP URL and Site URL are Different’ is closed to new replies.