^^^ this is the point you’re missing.
(You’re conflating two different topics, believe it or not: “Readable/friendly URLs” and reading a path and taking some action based on what you find in the path.)
I don’t know that this will help you, as you probably need a more basic description / video about this, but I did a step by step explanation of a very similar idea (involving User names) here:
(In your case, you don’t need to do any fancy manipulation of the path argument, like I spent a bunch of time on in my example. But the basic technique is the same — snag the text from the path and then do some sort of search based on that value.)