title: ApiController returns 404 when ID contains period
body: <p>I have an ApiController and I want to use email addresses as the ID parameter for requests:</p>
  
  <pre><code>// GET api/employees/email@address.com
  public CompactEmployee Get(string id) {
     var email = id;
     return GetEmployeeByEmail(email);
  }
  </code></pre>
  
  <p>However, I cannot get this to work (returns <strong>404</strong>):</p>
  
  <p><code>http://localhost:1080/api/employees/employee@company.com</code></p>
  
  <p>The following all work:</p>
  
  <ul>
  <li><code>http://localhost:1080/api/employees/employee@company</code></li>
  <li><code>http://localhost:1080/api/employees/employee@company.</code></li>
  <li><code>http://localhost:1080/api/employees?id=employee@company.com</code></li>
  </ul>
  
  <p>I have set <code>relaxedUrlToFileSystemMapping="true"</code> in my web.config as <a href="http://haacked.com/archive/2010/04/29/allowing-reserved-filenames-in-URLs.aspx" rel="noreferrer">detailed by Phil Haack</a>.</p>
  
  <p>I would very much love the full email address to work, but any time the period is followed by any other character, the request returns a 404. Any help would be greatly appreciated!</p>
  
  <h2>Solution</h2>
  
  <p>Due to a lack of other options, I've headed in the direction Maggie suggested and used the answer from <a href="https://stackoverflow.com/a/11736971/90227">this question</a> to create a rewrite rule to automatically append a trailing slash when I need an email in the URL.</p>
  
  <pre><code>&lt;system.webServer&gt;
    ....   
    &lt;rewrite&gt;
      &lt;rules&gt;
        &lt;rule name="Add trailing slash" stopProcessing="true"&gt;
          &lt;match url="^(api/employees/.*\.[a-z]{2,4})$" /&gt;
          &lt;action type="Rewrite" url="{R:1}/" /&gt;
        &lt;/rule&gt;
      &lt;/rules&gt;
    &lt;/rewrite&gt;
  &lt;/system.webServer&gt;
  </code></pre>