Ignoring Sub-Application URL in FallbackForClientRoutes

Hi,

I have a SPA ServiceStack application, which has a FallbackForClientRoutes set up to return the default index.html page, to allow for client-side routing.

This works fine until deployed to my production environment, which contains a legacy WCF service set up as an application in IIS beneath my ServiceStack site, sitting at the /webservice/ route.

The problem is that requests to the /webservice/Service.svc URL are picked up and handled by the FallbackForClientRoutes handler.

Is there a way that I can ignore requests to /webservice/* within ServiceStack (or in the web.config/IIS) and just let them fall through to the sub application?

Thanks.

This issue is not due to FallbackForClientRoutes which is just the ServiceStack Service which handles the request,
the issue is that ASP.NET doesn’t allow handlers to fallback to allow on to the next handler and you likely have ServiceStack configured to handle the / root path.

You’ll need to either give WCF’s *.svc handler mapping higher priority than ServiceStack’s or move ServiceStack’s handler configuration to handle a different path to avoid the handler mapping conflict.

This isn’t an issue in .NET Core which does allow unhandled requests to fallback through lower priority handlers.

1 Like

Thanks for that, moving the *.svc handlers above ServiceStack’s fixed the problem for me.

1 Like