URL Rewrite for WCF services

Topics: Developer Forum
Oct 12, 2008 at 12:27 PM

I'm new to Isapi URL rewrite. I want to implement this for my WCF service, just want to rewrite the URL without *.svc extension.

Please help with the follow rewrite rule.

RewriteRule  ^/(User)/getProfile?id=(.+)$     /User.svc/getProfile?id=$2

I'm trying to set simple URL with this, but got Error 404.
Where do I get wrong on this regex?
Oct 14, 2008 at 5:30 AM
I don't really know why you would get a 404.  There are many possible reasons.
one possible reason is, you sent in a URL request like this:

This will cause a 404, if that URL does not exist.

Another possible reason:  you sent in a URL like  /User/getProfile?id=77
and in fact, there is no /User.svc configured.

Another possible reason is that /User.svc does not accept GET requests. 

And maybe there are other reasons, too.

But I cannot tell which of these reasons it is, because you haven't given me enough information.
You can diagnose this more effectively by looking in the IIRF log file.