In one of our web application, i need to send domain name (ex: domainname.com) as parameter with asp.net mvc routing. So i created a route definition like below:
routes.MapRoute(
name: "AccountDetail",
url: "{controller}/{action}/{htip}/{dname}",
defaults: new {
controller = "Account",
action = "Index"
},
);
Also i have a method defined in AccountController like below:
public ActionResult Details(string htip, string dname) { }
According to the this route config and method declared in controller, MVC generates urls like http://localhost:63740/Account/Details/N/domainname.com
and this is what i expect.
But if i follow this url, IIS's 404 error page welcomes me instead of any MVC related page. Because MVC doesn't handle the url, because of TLD at the end (.com).
How can i achieve to make MVC handle these urls?