title: $_SERVER['SCRIPT_NAME'] is /index.html when requesting any path with PHP built-in server and Symfony 2
body: <p>I have this weird behaviour where if the path does not contain a period (/whatever-something/a-page for example), the <code>$_SERVER</code> variable <code>SCRIPT_NAME</code> is replaced with index.html or index.php if they exist in the root folder. <code>SCRIPT_NAME</code> is the correct value: /whatever.something/a-page when there is no index.html or index.php in the root folder.</p>
  
  <p>I check the SCRIPT_NAME value in the router_dev.php that Symfony provides.</p>
  
  <p>I run the server like this: <code>app/console server:run</code></p>
  
  <p>Example 1 - GOOD</p>
  
  <pre><code>Directory structure:
  web/index.html
  
  Path:
  /whatever.something/a-page
  
  SCRIPT_NAME value:
  /whatever.something/a-page
  </code></pre>
  
  <p>Example 2 - GOOD</p>
  
  <pre><code>Directory structure (empty):
  web/
  
  Path:
  /whatever-something/a-page
  
  SCRIPT_NAME value:
  /whatever-something/a-page
  </code></pre>
  
  <p>Example 3 - WEIRD!</p>
  
  <pre><code>Directory structure:
  web/index.html
  
  Path:
  /whatever-something/a-page
  
  SCRIPT_NAME value:
  /index.html
  </code></pre>
  
  <p>This causes my app to serve the index.html on basically every request that doesn't contain a period.</p>
  
  <p>Can someone tell me what the hell is going on?</p>