Im building a custom site with PHP, and its almost like a CMS, here I will have categories, subcategories and pages/posts, so my expected URL is like
mysite.com/category/sub-category/page-name/
and this hierarchy is not constant, I may get 3 or more subcategories, and I will also have pagination parameters in same URL like
mysite.com/category/sub-category/page-name/6
So, in my site index.php will only handle all the URLs as like in other CMS, but Im not sure how to split this url and how to know which is page name, which pagination param, which is category parameter and all, please help me in achieving this.