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
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Help with rewriting URL to a subfolder Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
pradeep
Newbie
Newbie


Joined: 22 September 2009
Online Status: Offline
Posts: 3
Posted: 14 March 2011 at 12:23pm | IP Logged Quote pradeep

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 View pradeep's Profile Search for other posts by pradeep
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 15 March 2011 at 4:23am | IP Logged Quote Anton

It should be like this:

[ISAPI_Rewrite]

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

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


Joined: 22 September 2009
Online Status: Offline
Posts: 3
Posted: 15 March 2011 at 7:59am | IP Logged Quote pradeep

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 View pradeep's Profile Search for other posts by pradeep
 
pradeep
Newbie
Newbie


Joined: 22 September 2009
Online Status: Offline
Posts: 3
Posted: 15 March 2011 at 9:00am | IP Logged Quote pradeep

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 View pradeep's Profile Search for other posts by pradeep
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

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