create Url for Cms

hello,

I’m doing a small cms, but I have a problem, I can create and save pages in the database. I would like to know how to create links for recall. For example, I set the url in my cms (my_foo example) and the frontend I recall it, so as to make a query to get the content. The query would do it in the base url (my_foo, maybe. Htm) and my foo be taken with a Get. Or get the id of the page

I hope I explained myself, if you have any suggestions for improvement are very welcome

thanks