I often see websites with URLs like `domain.com/index.php/directory`. How does it work? It looks like there is a directory in a file.

I want to do the same on my own website. Sample code is appreciated.