title: Error with htaccess redirecting to php file, and php outputting file when user has permission
body: <p>This seems like a strange one to me; I have a directory of files that are dynamically uploaded and I need to check permission first before a user can open that file so I added htaccess to the directory with this:</p>
  
  <pre><code>RewriteEngine On
  RewriteRule ^(.*)$ ../../get_file.php [QSA]
  </code></pre>
  
  <p>Then I check in php for permission and if the user has permission, I am trying to serve the user the file like so:</p>
  
  <pre><code>//serve file back to user
  $full_file_name = 'uploads/conversation_attachments/'.$file_name;
  $filesize = filesize($full_file_name);
  header("Content-length: ".$filesize);
  header("Content-type: application/octet-stream");
  header("Content-Disposition: attachment; filename=".$full_file_name.";");
  readfile($full_file_name);
  </code></pre>
  
  <p>It spits back 'a' file but not 'the' file. So instead of getting the file "rYMmfk3j9BSrjaRC.pdf" with the $file_name="rYMmfk3j9BSrjaRC.pdf" I am getting a file called "uploads_conversation_attachments_rYMmfk3j9BSrjaRC.pdf". Somehow it is replacing the slashes with underscores it seems.</p>
  
  <p>Any one have any ideas why this is happening? Help would be much appreciated!</p>