locked
URL Rewrite for Web service RRS feed

  • Question

  • User-1778014093 posted

    hi all,

    i have a WCF service as follows:

    api.mysite.com/dir/service.svc

    and i want to enable clean url ideally so that api.mysite.com will internally route to api.mysite.com/dir/service.svc so when a client makes a call such as api.mysite.com/method?param=x then internally it should be like api.mysite.com/dir/service.svc/method?param=x

    id this possible and where can this be done?

    thanks in advance.

    Wednesday, February 25, 2015 2:36 PM

Answers

  • User-1818759697 posted

    Hi,

    For this situation, you can use the following rule in the web config file

    <rule name="ServiceRewrite" stopProcessing="true">
    
    <match url="^$" />
    
    <conditions>
    
    </conditions>
    
    <action type="Rewrite" url="" />
    
    </rule>
    

    For more information, you could refer to:

    http://forums.iis.net/t/1182190.aspx

    Regards

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 26, 2015 10:17 AM