Q:

ASP.NET MVC Routing Assistance

I have an ASP.NET MVC 2 web application which is supposed to receive a request from a rather stupid system. The system in question expects it to be a PHP site. It's not. The request I get is of the form:

http://myIP/index.php?oa=val1&da=val1&ud=val1

I have a controller with a method
Index(string oa, string da, string ud)

But I don't know how to get this request routed to this controller. I have tried
routes.MapRoute(  
  "R",  
  "index.php/{oa}/{da}/{ud}",  
  new { controller = "Home", action = "Index" }  
);

But to no avail. It works if the request comes in the format Index.php/val1/val2/val3, but when the request comes as shown above, it generates a 404.
Thanks.

A:

I would simply map the route to the "php" page. The query string parameters will not transpose into the route data.
routes.MapRoute("R","index.php", new { controller = "Home", action = "Index" });

and then for your action on the controller
public ActionResult Index() {
    string oa = Request.QueryString["oa"];
    string da = Request.QueryString["da"];
    string ud = Request.QueryString["ud"];

    //do the rest of your logic here (obviously)

    return View();
}

