This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: How to remove .svc extension from URLs? (Topic Closed Topic Closed) Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jamesrichards
Newbie
Newbie


Joined: 04 January 2009
Online Status: Offline
Posts: 2
Posted: 04 January 2009 at 10:55pm | IP Logged  

Hi,

I am working on a set of WCF Rest Services. I don't want the user to ever see or know about the .svc extension.

Let's say my service is hosted at:
http://localhost/MyProject/MyService.svc

Here are a couple of example URI templates as specified in the [WebGet(UriTemplate="...")] attributes of methods on my service.

/products
/products/{category}/{id}
/products/{category}/{id}?f={format}

What I would like is for the user to access these resources without seeing the .svc extension. So they should look like this to the user:

http://localhost/MyProject/MyService/products
http://localhost/MyProject/MyService/products/{category}/{id}
http://localhost/MyProject/MyService/products/{category}/{id}?f={format}

Of course, behind the scenes, the actual code that would be running would be located at:

http://localhost/MyProject/MyService.svc/products
http://localhost/MyProject/MyService.svc/products/{category}/{id}
http://localhost/MyProject/MyService.svc/products/{category}/{id}?f={format}

I have searched the Helicon forum and Google for an answer, but can't seem to find a specific example of how to do this. Of course, I've found answers like "just use Helicon's ISAPI Rewrite to reroute your urls".

I am looking for the specific rules to put in my httpd.conf file to make this work.

I am using the Lite version on Windows XP with IIS 5.x during development. I expect to be deploying to Windows 2003 with IIS 6, so the solution needs to work for both.

Many thanks in advance!

 



Edited by jamesrichards - 04 January 2009 at 11:00pm
Back to Top View jamesrichards's Profile Search for other posts by jamesrichards
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 05 January 2009 at 6:10am | IP Logged  

Please try to apply the following config:

RewriteBase /
RewriteRule ^MyProject/MyService/products(.*)?$ MyProject/MyService.svc/products$1 [NC,L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
jamesrichards
Newbie
Newbie


Joined: 04 January 2009
Online Status: Offline
Posts: 2
Posted: 05 January 2009 at 12:29pm | IP Logged  

Hi Anton,

That worked perfectly! Thank you for your prompt reply. The best to you in 2009!

James

Back to Top View jamesrichards's Profile Search for other posts by jamesrichards
 

Sorry, you can NOT post a reply.
This topic is closed.

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You can vote in polls in this forum