I have gotten code from a developer (who's unavailable right know) that uses the url to call a function.
Let's say I open website.com/shortcut/first/second, it's supposed to call a function
someFunction(first, second)
The problem is not so much on how to use the url segments as arguments, I can figure that out myself (although quick ideas are apreciated) but rather how I can use a php file for any link entered with a certain directory, meaning shortcut/a/b, shortcut/1/8 and shortcut/dsfj/3290 all using that code.
I'm using it on a Wordpress page and have tried the template approach, as well as (and I prefer this) adding the directory directly to my html root.