Question:
I create wiki software, mainly a clone of wikipedia / mediawiki, but in ASP.NET MVC (this is MVC, so we donβt recommend ScrewTurn to me).
Now I have a question:
I use this route mapping to direct a URL, for example:
http://en.wikipedia.org/wiki/ASP.NET
routes.MapRoute( "Wiki", // Routenname //"{controller}/{action}/{id}", // URL mit Parametern "wiki/{id}", // URL mit Parametern new { controller = "Wiki", action = "dbLookup", id = UrlParameter.Optional } // Parameterstandardwerte );
Now it just seemed to me that there might be names like "AS / 400":
http://en.wikipedia.org/wiki/AS/400
By the way, there is this one (the name is "Slash"):
http://en.wikipedia.org/wiki//
And this one:
http://en.wikipedia.org/wiki//dev/null
In general, Wikipedia has a list of interesting names: http://en.wikipedia.org/wiki/Wikipedia:Articles_with_slashes_in_title
How to make routes similar to this route?
Edit:
Something like:
If the URL starts with / Wiki /, and if it does not start with / wiki / Edit / (but not / Wiki / Edit) then pass the rest of the URL as an identifier.
Edit:
Hmm, another problem: How can I route this:
http://en.wikipedia.org/wiki/C&A
Wikipedia may ...
Edit:
According to Wikipedia, due to clashes with wikitext syntax, only the following characters can never be used in page names (and they are not supported by DISPLAYTITLE):
# < > [ ] | { }
http://en.wikipedia.org/wiki/Wikipedia:Naming_conventions_(technical_restrictions)#Forbidden_characters
Edit:
To allow * and &, put
<httpRuntime requestPathInvalidCharacters="" />
to the <system.web> section in the web.config file
(Found here: http://www.christophercrooker.com/use-any-characters-you-want-in-your-urls-with-aspnet-4-and-iis )