Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How to allow only routed url to be called with Rest controller?
  • Maybe I didn't titled correctly, but here is the detail:

    Say I have route configuration:

    '/v1/session' => '/rest/session'

    I only want user can enter the page via the routed url, which is '/v1/session'.
    If they entered via '/rest/session' returns 404 or 403 or whatever...

    How can I do that?
  • HarroHarro
    Accepted Answer
    Add a route for it and point it to a method that throws HttpNotFoundException or HttpNoAccessException (on the current Fuel version only).

    Route lookup are not recursive, once is route is found the lookup stops.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion