title: Dot character '.' in MVC Web API 2 for request such as api/people/STAFF.45287
body: <p>The URL I'm trying to let work is one in the style of: <a href="http://somedomain.com/api/people/staff.33311">http://somedomain.com/api/people/staff.33311</a> (just like sites as LAST.FM allow all sort of signs in their RESTFul &amp; WebPage urls, for example "<a href="http://www.last.fm/artist/psy%27aviah">http://www.last.fm/artist/psy'aviah</a>" is a valid url for LAST.FM).</p>
  
  <p>What works are following scenarios:
  - <a href="http://somedomain.com/api/people/">http://somedomain.com/api/people/</a> - which returns all people
  - <a href="http://somedomain.com/api/people/staff33311">http://somedomain.com/api/people/staff33311</a> - would work as well, but it's not what I'm after
  I'd want the url to accept a "dot", like the example below
  - <a href="http://somedomain.com/api/people/staff.33311">http://somedomain.com/api/people/staff.33311</a> - but this gives me a </p>
  
  <pre><code>HTTP Error 404.0 - Not Found
  The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
  </code></pre>
  
  <p>I've set up following things:</p>
  
  <ol>
  <li><p>The controller "PeopleController"</p>
  
  <pre><code>public IEnumerable&lt;Person&gt; GetAllPeople()
  {
      return _people;
  }
  
  public IHttpActionResult GetPerson(string id)
  {
      var person = _people.FirstOrDefault(p =&gt; p.Id.ToLower().Equals(id.ToLower()));
      if (person == null)
          return NotFound();
  
      return Ok(person);
  }    
  </code></pre></li>
  <li><p>The WebApiConfig.cs</p>
  
  <pre><code>public static void Register(HttpConfiguration config)
  {
      // Web API configuration and services
  
      // Web API routes
      config.MapHttpAttributeRoutes();
  
      config.Routes.MapHttpRoute(
          name: "DefaultApi",
          routeTemplate: "api/{controller}/{id}",
          defaults: new { id = RouteParameter.Optional }
      );
  }
  </code></pre></li>
  </ol>
  
  <p>I already tried following all the tips of this blogpost <a href="http://www.hanselman.com/blog/ExperimentsInWackinessAllowingPercentsAnglebracketsAndOtherNaughtyThingsInTheASPNETIISRequestURL.aspx">http://www.hanselman.com/blog/ExperimentsInWackinessAllowingPercentsAnglebracketsAndOtherNaughtyThingsInTheASPNETIISRequestURL.aspx</a> but it still won't work.. I also think it's quite tedious and I wonder if there isn't another, better and more secure way.</p>
  
  <p>We have our Id's internally like this, so we're going to have to find a solution to fit the dot in one way or another, preferably in the style of "." but I'm open to alternative suggestions for urls if need be...</p>