I am trying to have my pages accessible with example.com/about
, example.com/contacts
instead of
example.com/about.php
& example.com/contact.php
I am not sure how this is done, but I was able to do it by creating link
<a href='site.com/about'> about </a>
And I have my index.php
set as
$URI = $_SERVER['REQUEST_URI'];
switch($URI){
case '/about';
include 'about.php';
break;
case '/contact';
include 'contact.php';
break;
//...
}
Now, asking if this is a good way will have my thread closed as objective question. But I would like to know, how it is done, or more accurately, how everyone does it.