title: Mapping URL into custom files
body: <p>I want to map URL in my localhost XAMPP into custom files.</p>
  
  <p>For example:</p>
  
  <ul>
  <li><code>localhost/index.php</code> --> <code>d:\xampp\htdocs\index.php</code> (default)</li>
  <li><code>localhost/normal/data.php</code> --> <code>d:\xampp\htdocs\normal\data.php</code> (default)</li>
  <li><code>localhost/view/userinfo.php</code> --> <code>d:\xampp\htdocs\view.php?p=userinfo</code> (custom)</li>
  <li><code>localhost/view/welcome.php</code> --> <code>d:\xampp\htdocs\view.php?p=welcome</code> (custom)</li>
  </ul>
  
  <p>So, basically, all URL that goes into inside <code>view</code> path will be mapped to view.php files with the filename.php (minus the .php) as its query parameter. There's actually no physical folder <code>view</code>, and no physical files userinfo.php and welcome.php <strong>inside</strong> the folder.</p>
  
  <p>The reason that I need to do this is that so I can pass all the pages that viewing data into an "application frame" that will wrap the page with header, menu, and footer, and I don't need to give header, menu, and footer call in each page. I might have the actual files userinfo.php that I can $include_once, or I might not (I can just generate it from within the view.php), but hey, that's one of the power of this kind of framework, right? And, if someday I need to change this structure, I can change it from just within one file (view.php), not all.</p>
  
  <p>Can I do this in PHP and XAMPP? How? I've noticed that some website <em>seems</em> to used this practice (URL which have no actual files or even path at all), but when I try to read tutorial for it, I got confused.</p>
  
  <p><a href="https://stackoverflow.com/questions/395650/url-mapping-in-php">URL mapping in PHP?</a></p>
  
  <p>The accepted answer listed 3 links to learn about URL rewriting. Mostly they're written for Apache in Linux, and mostly they pull all the possible scenario and configuration that I got confused which one I really need with all those long documents and technical jargon. I need just the practical step of my specific problem, and then, I will be able to start from there to explore myself if I have more advanced needs. Please help.</p>