I maybe expecting too much from ASP.NET, but in Apache it's trivial to rewrite urls so requesting something like: http://mysite/myfolder/mypage/niceurlparameter actually manages to serve static page http://mysite/mypage.html
How do I do that in Global.asax?
I've tried this:
RouteTable.Routes.MapPageRoute("Static HTML", "myfolder/{page}/*", "~/myfolder/{page}.html");
but it keeps returning 404 when i request http://mysite/myfolder/mypage/niceurlparameter.
However, this works:
RouteTable.Routes.MapPageRoute("Static HTML", "myfolder/{page}.html/*", "~/myfolder/{page}.html");
so I do get mypage.html when requesting http://mysite/myfolder/mypage.html/niceurlparameter.
I just want to get rid of ".html" part in my URLs. What am I missing?
UPDATE: For some reason, in former case the '*' wildcard has not been accepted.
Changing to:
RouteTable.Routes.MapPageRoute("Static HTML", "myfolder/{page}/{whatever}", "~/myfolder/{page}.html");
appears to route the request to html page, but then I get the error:
There is no build provider registered for the extension '.html'.
Why in the world it would just work in the former case (with html in URL), and not when html is left out?