purpose of life is joy


How to : remove .SVC extension from WCF service URL

By default, WCF service URL runs with .svc extension. sometimes, I felt that .svc extension is not useful when we reference or share the service URL to application or public. There is a very simple way I found to remove this extension and run as very plain URL with out any major coding.

Normally, URL looks like below


We need to change the above URL to below one. Looks simple and neat right?


Simple solution is to implement it at web.config level using URL re-writing which is very very simple. Other methods like writing custom URL Re writing module, configure at server level are little complex than compared to web.config changes.We have to apply changes under system.webserver as below

below WCFServiceName names alone we need to change according to your service name. try now with removing with .svc URL. Smile

Share your feedback!!!

    <modules runAllManagedModulesForAllRequests="true"/>
        <rule name="WCFServiceName" stopProcessing="true">
          <match url="^WCFServiceName/(.*)$"/>
          <action type="Rewrite" url="WCFServiceName.svc/{R:1}" />
blog comments powered by Disqus
Protected by Copyscape Web Plagiarism Check