Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Map files & querystrings Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
agarelli
Newbie
Newbie


Joined: 16 September 2008
Online Status: Offline
Posts: 5
Posted: 07 January 2010 at 5:44am | IP Logged Quote agarelli

Hi,

i'm having a problem with mine mapfile .

My rule is that:

RewriteEngine on
RewriteBase /

##### Permanent redirections (301) #####

RewriteMap mapfile txt:R301.txt
RewriteCond ${mapfile:$1|NOT_FOUND} !NOT_FOUND
RewriteRule (.*) ${mapfile:$1} [NC,QSA,R=301]

##### Fine Permanent redirections (301) #####

My mapfile is like that:

.....
web/default.asp?posizione=738&ramo= webX/index987.php
web/default.asp?posizione=740&ramo= webY/index456.php
web/default.asp?posizione=750&ramo= webZ/index321.php
web/default.asp?posizione=739&ramo= webK/index123.php
.....

The problem is that it does not seem to recognize the difference between the parameter "posizione" because it stop to read when it find the "?" .

How can solve the problem without change my mapfile ?

Hope I was clear .

Thanks for reply

A.
Back to Top View agarelli's Profile Search for other posts by agarelli
 
stowasser
Newbie
Newbie


Joined: 08 October 2008
Online Status: Offline
Posts: 14
Posted: 07 January 2010 at 5:29pm | IP Logged Quote stowasser

Try this:

RewriteMap mapfile txt:R301.txt
RewriteCond %{QUERY_STRING} posizione=(\d+) [NC]
RewriteCond ${mapfile:$1|NOT_FOUND} !NOT_FOUND
RewriteRule (.*) ${mapfile:$1} [NC,QSA,R=301]

Then you can change the map file to look like:

----------------------------
738&ramo= webX/index987.php
----------------------------

that is the way I have done it in the past.

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


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10487
Posted: 08 January 2010 at 3:39am | IP Logged Quote Anton

ISAPI_Rewrite doen't recognize the query string portion of your URL because it is processed separately from the rest of the URL in
RewriteCond %{QUERY_STRING} statement.

Please consider having the following config:

RewriteEngine on
RewriteBase /

##### Permanent redirections (301) #####

RewriteMap mapfile txt:R301.txt
RewriteCond %{QUERY_STRING} (.+)
RewriteCond ${mapfile:%1|NOT_FOUND} !NOT_FOUND
RewriteRule ^web/default\.asp$ ${mapfile:%1} [NC,R=301,L]

##### Fine Permanent redirections (301) #####

And mapfile like that:

.....
posizione=738&ramo= webX/index987.php
posizione=740&ramo= webY/index456.php
posizione=750&ramo= webZ/index321.php
posizione=739&ramo= webK/index123.php

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


Joined: 16 September 2008
Online Status: Offline
Posts: 5
Posted: 15 January 2010 at 8:34am | IP Logged Quote agarelli

Great.

It works fine.

Thanks a lot

A.
Back to Top View agarelli's Profile Search for other posts by agarelli
 

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