title: Using a colon (:) in a url with ASP.NET/IIS
body: <p>I'm implementing a custom controller in ASP.NET MVC and <em>really</em> want to be able to use a colon in the urls, so that I can identify class/column names and their values, like so:</p>
  
  <p><a href="http://example.com/user:chaiguy" rel="nofollow noreferrer">http://example.com/user:chaiguy</a></p>
  
  <p>...but apparently ASP.NET or IIS doesn't allow colons in urls. I did some digging and apparently it's considered a security issue, <em>but</em>, I'm using MVC and am handling <em>all</em> url paths manually (just treating them as strings), and not relating them to the file system, so I'm pretty sure this doesn't apply.</p>
  
  <p>I also heard some talk about implementing a custom Http handler or something.</p>
  
  <p>Any thoughts or ideas would be much appreciated.</p>
  
  <hr>
  
  <blockquote>
    <p>Er.... why? Seriously, why break standards? – Randolpho</p>
  </blockquote>
  
  <p>...</p>
  
  <blockquote>
    <p>I suggest, then, that you investigate building a web service. WCF is a nice technology for that, and it hosts well in IIS.</p>
  </blockquote>
  
  <p>I happen to like urls, and WCF is way too complicated for my purposes. I want it to be url-compatible, like REST, but capable of more than just navigating hierarchies, or doing well laid-out things. The problem I have with /users/chaiguy is that it is interpreting hierarchy where there is none: in my system "user" is a class, it's not a folder. user:chaiguy means the instance of the user class with the value of "chaiguy", and that is a single entity, that has the potential of having child-entities. So for example:</p>
  
  <p><code>/user:chaiguy/name</code></p>
  
  <p>...I would like to display the name of that entity. If I did this with your method, it would look like this:</p>
  
  <p><code>/users/chaiguy/name</code></p>
  
  <p>The problem is how do you know what's the class and what's the value? It could be interpreted as</p>
  
  <p><code>/users/chaiguy:name</code></p>
  
  <p>in my system, and that doesn't make sense. See what I'm getting at? To give a slightly more complicated example, suppose we want to select a child of the user entity out of multiple instances. So a user might have several email addresses. To select one, we might use:</p>
  
  <p><code>/user:chaiguy/email:me@here.com/</code></p>
  
  <p>So it is in fact recursive. It's not a file path, it's more like an XPath (or maybe similar to jQuery based on what little I know of it yet). That is, it's more of a dynamically-evaluated query selection than a hardwired file path. It gets evaluated on the server.</p>
  
  <p>Make no mistake, I'm not building a typical web site or even web service here.</p>