Load all page under same URL

I have a idea to load all the page/path under same URL or root domain. Is it possible to do this?.

Example :

Let say my domain is example.com and i have 3 pages index.php, contact.php, about/social.php and each file have different content. I want to load all file under my root domain if they click URL of any page in root file index.php

Example 2 :

  1. When someone visit example.com it will automatically (default) load index.php content and it have a link to other pages like contact.php and about/social.php
  2. When someone click a link of contact.php inside my root domain example.com, it will load the contact of contact.php but it should not change to example.com/contact.php instead it remain same example.com with the content of contact.php

Is this possible?. If yes, then you can help me with code/syntax in PHP or Javascript or htaccess