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 using long query string
Author
Message |
vallas
Newbie


Joined: 22 February 2012
Posts: 9
Posted: 05 March 2012 at 12:50pm

Hello again.

I have been looking at some examples and trying different
approaches with no luck yet.

I need to redirect URLs like these:
www.mysite.com/site1/support/parts.htm?
F=7&S=3&m=5&P=4&Nav=true

www.mysite.com/site1/support/parts.htm?
f=7&s=3&m=5&p=4&nav=true

(same as the previous but with letters in upper case)

so they end up like this:

www.mysite.com/site2/Pages/Detail.aspx?id=83&model=71

using a mapfile with records like these:

f=7&s=3&m=5&p=4&nav=true     id=83&model=71
F=7&S=3&m=5&P=4&Nav=true     id=83&model=71

This is my latest try:
RewriteCond %{QUERY_STRING} ^f=(.*)&s=(.*)&m=(.*)&p=
(.*)&nav=true$ [NC]
RewriteCond %{QUERY_STRING} ^F=(.*)&S=(.*)&m=(.*)&P=
(.*)&Nav=true$ [NC]
RewriteCond ${mapfile:%1%2%3%4|NOT_FOUND} !NOT_FOUND
RewriteRule ^site1/support/parts\.htm$
/site2/Pages/Detail.aspx?${mapfile:%1%2%3%4}?
[NC,R=301,L]

All help will be appreciated.
Back to Top
 
HeliconA
Admin Group


Joined: 02 March 2012
Posts: 4142
Posted: 06 March 2012 at 5:35am

hello,

try using the following:

Code:
RewriteCond %{QUERY_STRING} ^(.*)$ [NC]
RewriteCond ${mapfile:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^site1/support/parts\.htm$ /site2/Pages/Detail.aspx?${mapfile:%1}? [NC,R=301,L]


Leave entries in mapfile as they are.

Regards
Andrew
Back to Top
 
vallas
Newbie


Joined: 22 February 2012
Posts: 9
Posted: 06 March 2012 at 8:40am

Thank you very much Andrew.
Back to Top
 

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

Printable version Printable version