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>