Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Smart routing
  • Hi! I'm working on simple url shortener. I'd like to have short urls like this: http://www.example.com/a4fdX. Is there way to set following routing hierarchy: 1. Check if there exist corresponding controller (normal behave)
    2. If not -> route to controller Url but without setting all my standard routes like /admin, /short, etc. in routes.php. I want to prevent url like http://www.example.com/u/a4fdX if its possible. Cheers
  • The quickest way is to use the _404_ route to capture URL's than can't be routed. In the controller's action this routes to, check your parameter. If found, process it, if not, return a response with a 404 status and a 404 view...
  • Tricky ;) Thanks!

Howdy, Stranger!

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

In this Discussion