Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: RewriteRule to original URL Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
dshmuylo
Newbie
Newbie


Joined: 29 January 2010
Online Status: Offline
Posts: 3
Posted: 29 January 2010 at 1:24pm | IP Logged Quote dshmuylo

Hi there,

I'm trying to accomplish simple task as I thought. I have ISAPI version 2 running on the IIS 6.

Here is what I have:

RewriteRule /catalog/([^?]*) http://to_mysite.com/$1 [I,O,R,L]

Catalog is http://from_site/catalog.

It workes in terms of it redirects and you see content of the site that you want to redirect to.

The problem is it changes URL to target URL (http://to_site.com).

I want that it keep my original URL (http://from_site/catalog) in the browser.

 

Thanks a lot.

Back to Top View dshmuylo's Profile Search for other posts by dshmuylo
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 01 February 2010 at 2:33am | IP Logged Quote Anton

"I want that it keep my original URL" - in this case you need proxy functionality:

RewriteRule /catalog/([^?]*) http://to_mysite.com/$1 [I,O,P]

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


Joined: 29 January 2010
Online Status: Offline
Posts: 3
Posted: 01 February 2010 at 1:30pm | IP Logged Quote dshmuylo

Anton, Spasibo for reply!

Are you telling me that only I have to do is replace "R" for "P"?

Anyway I still have page not found for some reason. Below is diff variations that I'v tried:

#RewriteRule /catalog/([^?]*) http://to_site.com/$1 [I,O,R,L]
#RewriteRule ^catalog/(.+)$ http://to_site.com /catalog/$1
#RewriteRule /catalog/([^?]*) http://to_site.com/$1 [U,CL,]

Is "RewriteProxy" should be envoled instead "RewriteRule"?

Back to Top View dshmuylo's Profile Search for other posts by dshmuylo
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10489
Posted: 02 February 2010 at 4:38am | IP Logged Quote Anton

Yes, you need to use P flag to retain the requested URL in the address bar.

"Is "RewriteProxy" should be envoled instead "RewriteRule"?" - that's not necessary. RewriteProxy directive and P flag for RewriteRule do just
the same. Does this rule give 404?

RewriteRule /catalog/([^?]*) http://to_mysite.com/$1 [I,O,P]

If yes, can you access the destination directly as http://to_mysite.com/smth?

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


Joined: 29 January 2010
Online Status: Offline
Posts: 3
Posted: 03 February 2010 at 5:29pm | IP Logged Quote dshmuylo

I found solution that worked for me:

 

RewriteRule /catalog/([^?]*) http://to_mysite.com/$1 [I,P]

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

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