It’s called Pretty-URLs. A common way for frameworks to handle this is to redirect all traffic to the index.php and then deal with it programmatically.
So the rule within .htaccess redirect everything to index.php which then have it own set of rules. How you define/handle these rules and the resulting redirect/rendering is different from case to case.
This small helper library can help you with Pretty URL’s: https://github.com/codler/Startup