Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

Add version segment to WCF url

$
0
0

Is is possible to use url re-writing to add a version segment in the url?

For example, the raw url is something like: http://host.com/v2/categories/5 and I want it rewritten to http://host.com/categories/5

We have an additional rewrite rule to add the .svc segment to the url, so the web.config rewrite section looks something like this: 

<rewrite>
      <rules>
        <rule name="Remove version segment from the Url" stopProcessing="false">
          <match url="^v2(.*)$" />
          <action type="Rewrite" url="{R:0}" appendQueryString="true" />
        </rule>
        <rule name="Add ServiceHost.svc to the Url" stopProcessing="false">
          <match url="^(.*)$" />
          <action type="Rewrite" url="ServiceHost.svc/{R:0}" appendQueryString="true" />
        </rule>
      </rules>
    </rewrite>


Viewing all articles
Browse latest Browse all 27852

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>