• Resolved matricula

    (@matricula)


    It looks like ‘Proxy over Admin Ajax’ was removed from the list of REST API options so I am no longer able to add/remove redirects. I have a requirement to use ‘api’ as the api prefix instead of wp-json. Any advice on using this plugin with an alternate api prefix?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author John Godley

    (@johnny5)

    WHatever you are using to modify the URL should support the standard WordPress get_rest_url function, then it will be picked up by Redirection.

    Thread Starter matricula

    (@matricula)

    Thanks for the reply! get_rest_url returns the new api url and I’m able to access the API through the browser with the new url. I’m just adding the following to functions.php:

    add_filter( ‘rest_url_prefix’, ‘slug_rest_url_prefix’ );
    function slug_rest_url_prefix( $old ){
    return ‘api’;
    }

    Removing the lines above fixes the problem. I’ve made other arrangements so no big deal but I thought this might be a relatively easy problem to replicate and fix.

    Plugin Author John Godley

    (@johnny5)

    Redirection uses get_rest_url, so as long as that returns a valid URL for your REST API then Redirection will work. If it doesn’t then the problem is likely caused by something else such as a security plugin.

    Redirection should show details about the error and that may help point the way.

    Hello,
    First thank you for this wonderful plugin. I’ve been using it for years and it’s a life saving tool.

    I have the same problem but the new URL is detected properly:
    http://prntscr.com/m50c7h

    Yet when I try to do something: http://prntscr.com/m50d6i

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Alternate API Prefix’ is closed to new replies.