title: htaccess get filename without path
body: <p>I'm trying to get the requested <strong>filename without the path</strong> with htaccess for a RewriteCond.
  <code>REQUEST_FILENAME</code> returns the full absolute path, but I only need the filename like <em>test.php</em></p>
  
  <p>I've been searching for this a lot but couldn't find anything that helped me out.
  Thanks for any responses in advance!</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Im trying to do something like this:</p>
  
  <pre><code>RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond _%{REQUEST_FILENAME}.php -f
  RewriteRule ^([^/]*)$ _$1.php [L]
  </code></pre>
  
  <ul>
  <li>The URL typed in the browser looks like this: <a href="http://example.org/test" rel="nofollow">http://example.org/test</a></li>
  <li>The File that will be requestested by the RewriteRule is: <a href="http://example.org/_test.php" rel="nofollow">http://example.org/_test.php</a></li>
  <li>With <code>RewriteCond _%{REQUEST_FILENAME}.php -f</code> i tried to check <strong>if the file exists</strong> first  </li>
  </ul>
  
  <p><strong>Basically I want to do this:</strong></p>
  
  <p>URI: <em>/test/blah</em><br>
  Check if _<em>test.php</em> exists (with underscore!)</p>