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

后端 未结 7 905
借酒劲吻你
借酒劲吻你 2020-11-29 17:41

In my knowledge, the RESTful WCF still has \".svc\" in its URL.

For example, if the service interface is like

[OperationContract]
[WebGet(UriTemplate         


        
7条回答
  •  孤城傲影
    2020-11-29 18:02

    In IIS6 or 7, you can use IIRF, a free rewriting filter. Here's the rule I used:

    # Iirf.ini
    #
    
    RewriteEngine ON
    RewriteLog  c:\inetpub\iirfLogs\iirf-v2.0.services
    RewriteLogLevel 3
    StatusInquiry  ON  RemoteOk
    CondSubstringBackrefFlag *
    MaxMatchCount 10
    
    # remove the .svc tag from external URLs
    RewriteRule  ^/services/([^/]+)(?

提交回复
热议问题