I'm new to URL Rewrite.
I created a WCF Rest service, and I'm trying to set a rewrite rule that will allow invoking the service when the svc extension is hidden.
I have a method named "Test" on that service, that I invoke successfully with the svc extension present.
What I did:
Did IISReset (Several times).
I'm getting a 404 when trying this URL:
http://localhost/WcfTestApp/Service1/Test
Additional Stuff:
I also enabled "Failed Request Tracing Rules" But I see no logs created in the folder.
Any Ideas why it isn't working as I expect?
Thanks in advance for any help.
What I did to resolve it:
I fixed the failed request tracing log files not appearing, turns out you need to configure in the IIS settings the status codes for which the trace should occur, as it's not smart enough to select all by default.
Then via the trace file (which I opened in IE), I noticed my rewrite rule needed a slight modification, as I was able to see what URL I got, and what it was rewritten to (which did not work).
Eventually, that's what I used.
<rule name="RemoveSvcExtension" stopProcessing="true">
<match url="^(.*)Service1/(.*)$" />
<action type="Rewrite" url="{R:1}Service1.svc/{R:2}" logRewrittenUrl="true" />
</rule>