title: How can I use a wildcard alias for file names in apache config?
body: <p>I need apache to call file.php when either of the following urls are called:</p>
  
  <ul>
  <li>/file.xml</li>
  <li>/file-contents.xml</li>
  <li>/file-abc.xml</li>
  <li>/file-<em>n</em>.xml</li>
  <li>/file-xyz.xml</li>
  </ul>
  
  <p>Here's a sample from my apache conf file: (the second to last line is the critical one)</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
      DocumentRoot /html
      ServerName domain.com
  
      UseCanonicalName Off
  
      Alias /file.xml /html/file.php
      Alias /file-contents.xml /html/file.php
      Alias /file-*.xml /html/file.php
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I can get file.xml and file-contents.xml to call file.php just fine.  But wildcards aren't working.</p>
  
  <p>What do you recommend?</p>
  
  <hr>
  
  <p><strong>ANSWER:</strong></p>
  
  <p>Thanks to Marc B!</p>
  
  <pre><code>AliasMatch ^/file-(.*).xml /html/file.php
  </code></pre>