I've been hired to re-factor some homemade websites. Those websites are made in the good old fashion way: one page = one php file with header, content, script, footer. Now my client wants to update the layout of all the pages I feel like DRYing a bit the code by creating a clean URL system. Instead of :
example.com/page1.php, example.com/page2.php
I'd like to have:
example.com/page1, example.com/page2
Where the two pages call the same php file just charging the content of the page.
My questions are: 1. how to catch the URL and converts it into parameters? 2. how to avoid the website default behavior to search in directory /page1 or /page2?