Reject (Hard 404) ASP.NET MVC-style URLs
- by James D
Hi,
ASP.NET MVC web app that exposes "friendly" URLs:
http://somesite.com/friendlyurl
...which are rewritten (not redirected) to ASP.NET MVC-style URLs under the hood:
http://somesite.com/Controller/Action
The user never actually sees any ASP.NET MVC style URLS. If he requests one, we hard 404 it. ASP.NET MVC is (in this app) an implementation detail, not a fundamental interface.
My question: how do you examine an arbitrary incoming URL and determine whether or not that URL matches a defined ASP.NET MVC path?
For extra credit: how do you do it from inside an ASP.NET-style IHttpModule, where you're getting invoked upstream from the ASP.NET MVC runtime?
Thanks!