Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x support forum
 Helicon Tech : ISAPI_Rewrite 2.x support forum
Subject Topic: Rewrite folder to domain Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
jensor
Newbie
Newbie


Joined: 19 October 2006
Online Status: Offline
Posts: 2
Posted: 03 July 2008 at 11:09pm | IP Logged Quote jensor

I would like to rewrite something like www.mysite.com/siteb to www.anotherdomainname.com.  This would apply for all pages under the siteb folder.  I would also like to be able to reference www.anotherdomainname.com/page.aspx and have it rewrite to the real page.aspx under siteb.  I need anotherdomain.com to remain in the address bar whenever pointing to the siteb folder.  I am on 2.x.

I need two domains...but I need them to share session and I was wondering if this might help me accomplish that goal with a rewrite rule.  Any help is appreciated.

Back to Top View jensor's Profile Search for other posts by jensor
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7598
Posted: 28 July 2008 at 5:27pm | IP Logged Quote Lexey

Try this:

RewriteCond Host: www\.mysite\.com
RewriteCond METHOD GET|HEAD
RewriteRule /siteb(/.*)? http\://www.anotherdomain.com?1$1:/ [I,RP]

RewriteCond Host: www.anotherdomain.com
RewriteRule /(?!siteb/)(.*) /siteb/$1 [I,L]
Back to Top View Lexey's Profile Search for other posts by Lexey
 
ninenines
Newbie
Newbie


Joined: 02 August 2008
Online Status: Offline
Posts: 1
Posted: 02 August 2008 at 9:15pm | IP Logged Quote ninenines

Hi, I have a similar need as well. I searched the forums, but couldn't find a solution. Is the below scenario possible to do?

I have two domains, let's say 123.com and abc.net.

I need to rewrite 123.com/abc/* to abc.net without changing the URL.

Basically, entering www.123.com/abc/sectionA would rewrite to www.abc.net/sectionA, but the URL in the browser remains www.123.com/abc/sectionA. 


Any help or direction would be great. Thanks.
Back to Top View ninenines's Profile Search for other posts by ninenines
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7598
Posted: 07 August 2008 at 6:54pm | IP Logged Quote Lexey

If both www.123.com and www.abc.net are served by the same IIS site then the following rewrite is possible:

RewriteCond Host: www\.abc\.net
RewriteRule /sectionA http\://www.abc.net/sectionA/ [I,RP]

RewriteCond Host: www\.abc\.net
RewriteRule /sectionA(/.*) /abc/sectionA$1 [I,L]

Otherwise a proxiing is needed here.
Back to Top View Lexey's Profile Search for other posts by Lexey
 

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