I'm terrible at regex, but anybody can help here. We have redirect all path to one method but we don't want it if path has any images extension.
I have tried but current code is totally fail.
routes.MapRoute(
name: "DefaultCMS",
url: "{*paths}",
defaults: new
{
controller = "Home",
action = "Index",
paths = UrlParameter.Optional
},
constraints: new { paths = @".*\.(jpeg|gif|jpg|png)(/.)?)" } // this regex only allow if path has this extension.
);