You can create a general action method that accepts the viewName parameter:
public ActionResult Show(string viewName) { return View(viewName); }
Then you can redirect these names to this action:
routes.MapRoute( "Simple Content", "/{viewName}", new { controller = "Something", action = "Show" }, new { viewName = "Research|Facility|Contact" } );
A viewName restriction viewName necessary to prevent this route from matching arbitrary URLs.
Beware that this is a disclosure vulnerability; an attacker can request /ControllerName/Show?viewName=~/Views/Secret/View .
If you have any confidential views that do not use models, you must confirm the viewName in action.
You can use an enumeration for this, as in dknaack's answer .
SLaks source share