How to create routing for the pages

Hi, I have a pages folder there i have few pages ex: example.php, post.php, and my index.php inside site root, I do have header with navbar as php include. How do i create routing for those pages and use it in header.php(which is php include in index.php). I followed the docs but i get problem to make them work. It works for first click but if i click second time then again its routing to same routing as an seperate page and not found error thrown. such as below,

say / - for index.php and name of the routing is home
/example/ - example.php inside pages folder pages/example.php as URL,

when clicking first time on Example nav link, i go to /example/ and shows the correct page. if i click again on Example then it goes to pages/example/ (404 error). also if i click on home page while in example page, i go to /pages/ which 403 forbidden.

any help? or suggestion to solve this…appreciated.

Community Page
Last updated: