This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Help with rewriting URL to a subfolder
Author
Message |
pradeep
Newbie


Joined: 22 September 2009
Posts: 3
Posted: 14 March 2011 at 12:23pm

I am using V2.x and trying to rewrite the following

http://www.domain.com/virtualdir/subfolder/test.aspx to
http://www.domain.com/subfolder/test.aspx

I would really appreciate if you could please provide me
with a rule to achieve this

Thanks.
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 15 March 2011 at 4:23am

It should be like this:

[ISAPI_Rewrite]

RewriteRule /subfolder/test\.aspx /virtualdir/subfolder/test.aspx [I,L]

__________________
Regards,
Anton
Back to Top
 
pradeep
Newbie


Joined: 22 September 2009
Posts: 3
Posted: 15 March 2011 at 7:59am

Anton, Thanks for your reply. This was what I was looking
for.

One thing I noticed is when accessing the URL as

http://www.domain.com/subfolder/(.*) it works fine with
the rule in place

But when I try this URL

http://www.domain.com/virtualdir/subfolder/(.*)

it is not getting rewritten to

http://www.domain.com/subfolder/(.*)

Another thing I wanted to mention is that "subfolder"
does NOT physically exist in the path for the rewritten
URL below

http://www.domain.com/subfolder/(.*)

Please advise.
Back to Top
 
pradeep
Newbie


Joined: 22 September 2009
Posts: 3
Posted: 15 March 2011 at 9:00am

Anton, I think I figured out how that scenario can be
handled.

I did a redirect rule first for requests that come in as

http://www.domain.com/virtualdir/subfolder/(.*)

which will be caught by the following rule

RewriteRule /virtualdir/subfolder/(.*)$ /subfolder/$1
[I,RP]

and redirected to the rule you had provided

RewriteRule /subfolder/(.*) /virtualdir/subfolder/$1
[I,L]

Hope I have not missed anything and thanks for your help
again.
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
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 cannot vote in polls in this forum