Previous Next

Thread: Hiding the .svc extension for WCF services

Last post 07-25-2008 12:45 PM by ruslany. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 07-25-2008, 2:34 AM

    • kannank
    • Not Ranked
    • Joined on 07-25-2008, 4:56 AM
    • Posts 2

    Hiding the .svc extension for WCF services

    Does anyone know how do I set up a rule using the rewrite module to hide the .svc extension from the url so that I can have it more REST friendly.

    For ex. instead of having something like

    http://localhost/photoalbum.svc/photos/cat

    I would like to have it as

    http://localhost/photoalbum/photos/cat

    Regards,
    Kannan

  • 07-25-2008, 12:45 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 3:38 PM
    • Redmond, WA
    • Posts 207

    Re: Hiding the .svc extension for WCF services

    try this:

    <rule name="Hide svc">
      <match url="^photoalbum/([0-9a-zA-Z/]+)$">
      <action type="Rewrite" url="photoalbum.svc/{R:1}">
    </rule>

    http://ruslany.net
    Tags:
Page 1 of 1 (2 items)
Page view counter