title: URLs with slash in parameter?
body: <p>Question: </p>
  
  <p>I am creating a wiki software, basically a clone of wikipedia/mediawiki, but in ASP.NET MVC (the MVC is the point, so don't recommend me ScrewTurn).</p>
  
  <p>Now I have a question:</p>
  
  <p>I use this route mapping, to route a URL like:<br />
  <a href="http://en.wikipedia.org/wiki/ASP.NET">http://en.wikipedia.org/wiki/ASP.NET</a></p>
  
  <pre><code>        routes.MapRoute(
              "Wiki", // Routenname
              //"{controller}/{action}/{id}", // URL mit Parametern
              "wiki/{id}", // URL mit Parametern
              new { controller = "Wiki", action = "dbLookup", id = UrlParameter.Optional } // Parameterstandardwerte
          );
  </code></pre>
  
  <p>Now it just occured to me, that there might be titles like 'AS/400':<br />
  <a href="http://en.wikipedia.org/wiki/AS/400">http://en.wikipedia.org/wiki/AS/400</a></p>
  
  <p>Incidentially, there is also this one (title 'Slash'):<br />
  <a href="http://en.wikipedia.org/wiki//">http://en.wikipedia.org/wiki//</a></p>
  
  <p>And this one:<br />
  <a href="http://en.wikipedia.org/wiki//dev/null">http://en.wikipedia.org/wiki//dev/null</a></p>
  
  <p>Overall, Wikipedia seems to have a list of interesting titles like this:
  <a href="http://en.wikipedia.org/wiki/Wikipedia:Articles_with_slashes_in_title">http://en.wikipedia.org/wiki/Wikipedia:Articles_with_slashes_in_title</a></p>
  
  <p>How do I make routes like this route correctly ?</p>
  
  <p><strong>Edit:</strong> <br />
  Something like: <br />
  If the URL starts with /Wiki/, and if it doesn't start with /wiki/Edit/
  (but not /Wiki/Edit)
  then pass all the rest of the URL as Id.</p>
  
  <p><strong>Edit:</strong> <br />
  Hmm, just another problem:
  How can I route this one:<br />
  <a href="http://en.wikipedia.org/wiki/C&amp;A">http://en.wikipedia.org/wiki/C&amp;A</a></p>
  
  <p>Wikipedia can...</p>
  
  <p><strong>Edit:</strong><br />
  According to wikipedia, due to clashes with wikitext syntax, only the following characters can never be used in page titles (nor are they supported by DISPLAYTITLE):</p>
  
  <pre><code># &lt; &gt; [ ] | { }
  </code></pre>
  
  <p><a href="http://en.wikipedia.org/wiki/Wikipedia:Naming_conventions_(technical_restrictions)#Forbidden_characters">http://en.wikipedia.org/wiki/Wikipedia:Naming_conventions_(technical_restrictions)#Forbidden_characters</a></p>
  
  <p><strong>Edit:</strong><br />
  To allow * and &amp;, put</p>
  
  <pre><code>&lt;httpRuntime requestPathInvalidCharacters="" /&gt;
  </code></pre>
  
  <p>into section &lt;system.web&gt; in file web.config</p>
  
  <p>(Found here: <a href="http://www.christophercrooker.com/use-any-characters-you-want-in-your-urls-with-aspnet-4-and-iis">http://www.christophercrooker.com/use-any-characters-you-want-in-your-urls-with-aspnet-4-and-iis</a>)</p>