I'm writing a site in PHP that I would like to have structures, nice, and pretty URLs in. I know in one site I had rules setup in the .htaccess
, but I have to have some of these URL rules created dynamically, so is there a way to do that in the PHP itself? I feel like Wordpress does this somehow with its pages.
Basically, if I go to this page:
site.com/users/Xan
it will technically be loading:
site.com/users?name=Xan
I can write the patterns (using regex) fairly easily. I just need to know how to make this possible.