title: Multiple emails are sent with rewrite rule in place
body: <p>I have the following rewrite rule in place in my .htaccess file</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine on
  
  RewriteBase /
  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?$1 [L,QSA]
  
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>In the index.php file, I am sending myself an email via the PHP mail function.</p>
  
  <pre><code>&lt;?php
  $body = "&lt;html&gt;";
  $body .= "&lt;body&gt;";
  $body .= $_SERVER['REMOTE_ADDR'];
  $body .= "&lt;/body&gt;";
  $body .= "&lt;/html&gt;";
  
  $headers  = 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
  $headers .= 'From: XXX@domain.com' . "\r\n";
  
  mail('XXX@mail.com', 'IP TEST', $body, $headers, "-fXXX@domain.com");
  ?&gt;
  </code></pre>
  
  <p>When I access the URL in a web browser <a href="http://sub.domain.com" rel="nofollow">http://sub.domain.com</a>, TWO emails are being sent to me.</p>
  
  <p>Same goes for when I access <a href="http://sub.domain.com/index.php" rel="nofollow">http://sub.domain.com/index.php</a></p>
  
  <p>When I comment everything out in the .htaccess file, only ONE email is sent.</p>
  
  <p>I don't get it!</p>