title: index.php not working properly?
body: <p>So I need to put together simple website using php- header and footer will be the same and the middle section changes. I need to be able to click on the link in header and change the section (hem or nyheter, hem is the default).
  What may be the reasons the following code does not work once I click on link in the header? It loads correctly the first time, but once I click on the link, the header and footer does not load, only the section part opens in a browser.
  I have htaccess file and header, footer and sections files are on the same level.</p>
  
  <p>Thanks in advance!</p>
  
  <pre><code>&lt;?php
  
  $sections = array("hem", "nyheter");
  $sectionTitles = array("HEM", "NYHETER");
  
  $section = "hem";
  
  $content = explode("/", $_SERVER['REQUEST_URI']);
  
  if (!empty($content[2]) &amp;&amp; (in_array($content[2], $sections))) { $section = $content[2];}
  
  include ("header.php");
  include ("$section.php");
  include ("footer.php");
  
  ?&gt;
  </code></pre>
  
  <p>Header code: </p>
  
  <pre><code>&lt;body&gt;
      &lt;a href="hem"&gt;hem&lt;/a&gt; | &lt;a href="nyheter"&gt;nyheter&lt;/a&gt;
  </code></pre>
  
  <p>.htaccess: </p>
  
  <pre><code> RewriteEngine On
   RewriteCond %{REQUEST_URI} !\.(php|css|js|gif|png|jpe?g|pdf|eot|svg|ttf|woff|ico)$
   RewriteRule (.*)$ index.php [L]
  </code></pre>