asp.net web api - Opening Default document on IIS -
i've deployed asp.net web api website on same folder consume it.
when type url on browser such http://domain.com/ returns 404, if type http://domain.com/index.html works!
i wanna know if there's way configure on web api route, define default route it, redirecting http://domain.com/index.html when type http://domain.com/
i've tried ti put on web.config without success:
<defaultdocument enabled="true"> <files> <add value="/index.html" /> </files> </defaultdocument>
also, set iis accept index.html default document. no success =/
any ideas?
i'm not sure if best way achieve this, edited routeconfig.cs such this:
public class routeconfig { public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maproute( name: "default", url: "index.html" ); } }
now can http://domain.com works perfectly!
i'd love if have best way achieve this!
Comments
Post a Comment