How to remove the “.svc” extension in RESTful WCF service?

I know this post is a bit old now, but if you happen to be using .NET 4, you should look at using URL Routing (introduced in MVC, but brought into core ASP.NET).

In your app start (global.asax), just have the following route configuration line to setup the default route:

RouteTable.Routes.Add(new ServiceRoute("mysvc", new WebServiceHostFactory(), typeof(MyServiceClass)));

then your URLs would look like this:

http://servername/mysvc/value/2

HTH

Leave a Comment