title: RewriteRule in DirectoryMatch for addresses without extension
body: <p>I want it so that all URL requests without a ".php" extension are handled by the appropriate .php file, and still be able to name those files with the ".php" extension.</p>
  
  <pre><code>&lt;DirectoryMatch "/var/www/html"&gt;   #This works for the one directory
      RewriteEngine on
      RewriteRule "^(\w+)$" "$1.php"
  &lt;/DirectoryMatch&gt;
  </code></pre>
  
  <p>This is what should work for all subdirectories:</p>
  
  <pre><code>&lt;DirectoryMatch "^(/var/www/htm).*"&gt;    #This does not work
  </code></pre>
  
  <p>Here's a list of things I've tried that I thought should all be the same but aren't:</p>
  
  <pre><code>&lt;DirectoryMatch "/var/www/html"&gt;     #this works
  &lt;DirectoryMatch /var/www/html&gt;       #this works 
  &lt;DirectoryMatch "^/var/www/html"&gt;    #"The requested URL was not found on this server."
  &lt;DirectoryMatch "^/var/www/html$"&gt;   #"The requested URL was not found on this server."
  &lt;DirectoryMatch "^(/var/www/html)$"&gt; #"The requested URL was not found on this server."
  &lt;DirectoryMatch "^(/var/www/htm).*"&gt; #"The requested URL was not found on this server."
  </code></pre>
  
  <p>It seems as soon as I actually use regular expressions, it no longer works.  However, the regular expression in the rewrite rule does work.</p>
  
  <p>Why isn't the regex working for DirectoryMatch?</p>