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: rewrite condition question
Author
Message |
skunala
Newbie


Joined: 08 October 2010
Posts: 3
Posted: 08 October 2010 at 10:19am

Hi,

I am trying to write a rewrite condition that basically looks to see if a stateCode included as query string parameter belongs to a pre-determined list of state codes. If it is one of the state codes in the list then, it redirects to a different url and passes the state code as a query string to this new url.

Here is an example:

pre-determined state code list: AL, CA, NY, PA, MO

Scenario 1:

Incoming URL: www.mysite.com/dosomthing?stateCode=MO

New URL:  www.adifferentsite.com/dosomthingElse?stateCode=MO

Scenrarion 2:

Incoming URL: www.mysite.com/dosomthing?stateCode=FL

New URL:  no rewriting required in this case since the state code isnt there in the list.

I really appreciate any help with this regards.

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 11 October 2010 at 7:10am

The config should look like this:

[ISAPI_Rewrite]
RewriteCond Host: www\.mysite\.com
RewriteRule /dosomthing\?stateCode=(AL|CA|NY|PA|MO) http\://www.adifferentsite.com/dosomthingElse\?stateCode=$1 [I,RP]

__________________
Regards,
Anton
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