This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Mapfile with new querystring values
Author
Message |
vallas
Newbie


Joined: 22 February 2012
Posts: 9
Posted: 23 February 2012 at 3:15pm

Hello again.

We made some changes to our data and current pages like
these:

http://www.mysite.com/site1/pages/product.aspx?modelId=11
http://www.mysite.com/site1/pages/type.aspx?typeid=22
http://www.mysite.com/site1/pages/family.aspx?famid=33

Should now point to:

http://www.mysite.com/site1/pages/product.aspx?modelId=87
http://www.mysite.com/site1/pages/type.aspx?typeid=25
http://www.mysite.com/site1/pages/family.aspx?famid=58

As you can see, we are only changing the last numeric
values. Since we have many such cases we would like to
use a mapfile with values like:

modelId=11   modelId=87
typeid=22    typeid=25
famid=33     famid=58

Can you help us with the commands?

Thanks.
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 24 February 2012 at 5:53am

Hello,

you'll need 3 mapfiles. 1 mapfiles for each type of querysyting.

Code:
RewriteEngine on
RewriteBase /
RewriteMap mapfile1 txt:mapfile1.txt
RewriteMap mapfile2 txt:mapfile2.txt
RewriteMap mapfile3 txt:mapfile3.txt

RewriteCond %{QUERY_STRING} (.*)
RewriteCond ${mapfile1:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^site1/pages/product\.aspx$ /site1/pages/product.aspx?${mapfile1:%1}? [NC,L]

RewriteCond %{QUERY_STRING} (.*)
RewriteCond ${mapfile2:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^site1/pages/type\.aspx$ /site1/pages/type.aspx?${mapfile2:%1}? [NC,L]

RewriteCond %{QUERY_STRING} (.*)
RewriteCond ${mapfile3:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^site1/pages/family\.aspx$ /site1/pages/family.aspx?${mapfile3:%1}? [NC,L]


Regards
Andrew
Back to Top
 
vallas
Newbie


Joined: 22 February 2012
Posts: 9
Posted: 27 February 2012 at 1:22pm

Thank you very much!
Back to Top
 

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

Printable version Printable version