Forum Moderators: phranque
www.bla.com/nl/b2bmanagement/EXE/jedi.proxb2b.subscribe_newsletter?p_proc=1&p_email=&p_company_name=wcxvxc&P_LAST_NAME=cxwvx&P_FIRST_NAME=&p_lang=NL Now my problem is that the gateII also takes the parameters from query_string. So I want to give query_string seperate to the function. I try to replace all '=' and '&' charcters of query_string. this works for links with a small amount of parameters:-(. Does somebody know a better way to convert characters.
My code
RewriteCond %{QUERY_STRING} (.*)=(.*)
RewriteRule (.*) - [env=QRY_STR:%1:%2]
#
RewriteCond %{QUERY_STRING} (.*)=(.*)&(.*)=(.*)
RewriteRule (.*) - [env=QRY_STR:%1:%2¦%3:%4]
#
RewriteCond %{QUERY_STRING} (.*)=(.*)&(.*)=(.*)&(.*)=(.*)
RewriteRule (.*) - [env=QRY_STR:%1:%2¦%3:%4¦%5:%6]
#
RewriteCond %{QUERY_STRING} (.*)=(.*)&(.*)=(.*)&(.*)=(.*)&(.*)=(.*)
RewriteRule (.*) - [env=QRY_STR:%1:%2¦%3:%4¦%5:%6¦%7:%8]
#
RewriteCond %{QUERY_STRING} (.*)=(.*)&(.*)=(.*)&(.*)=(.*)&(.*)=(.*)&(.*)=(.*)
RewriteRule (.*) - [env=QRY_STR:%1:%2¦%3:%4¦%5:%6¦%7:%8¦%9:%10]
#
RewriteCond %{QUERY_STRING} (.*)=(.*)&(.*)=(.*)&(.*)=(.*)&(.*)=(.*)&(.*)=(.*)&(.*)=(.*)
RewriteRule (.*) - [env=QRY_STR:%1:%2¦%3:%4¦%5:%6¦%7:%8¦%9:%10¦%11:%12]
#
RewriteRule ^/(NL¦FR¦EN)/(.+)/$ /gate/JEDI.gate.gateII?lang=$1&p2=$2&loglevel=%{ENV:LOGLEVEL}&page=%{ENV:PAGE}&query_string=%{ENV:QRY_STR} [last,nocase,proxy]
In the end I must become a link like this:
wwww.bla.com/nl/b2bmanagement/EXE/jedi.proxb2b.subscribe_newsletter?p_proc:1¦p_email:¦p_company_name:wcxvxc¦P_LAST_NAME:cxwvx¦P_FIRST_NAME:¦p_lang:NL
wwww.bla.com/nl/b2bmanagement/EXE/jedi.proxb2b.subscribe_newsletter?p_proc:1¦p_email:¦p_company_name:wcxvxc¦P_LAST_NAME:cxwvx¦P_FIRST_NAME:p_proc0¦p_proc1:p_proc2
The two most-attractive suggestions I can think of are:
1) Use RewriteMap to call a script to do the mass character substitution. Changing the characters would be fast and easy in PERL, for example. RewriteMaps must be defined in the server-config context, but may be used in any context.
2) Change your existing script to accept the 'wrong' characters and change them to the right ones internally. You could change the scripts themselves, or add a 'shell' around them to do the character substition and then call the correct script.
Note that
RewriteCond %{QUERY_STRING} (.*)=(.*)
RewriteRule (.*) - [env=QRY_STR:%1:%2]
RewriteCond %{QUERY_STRING} ([^=]*)=(.*)
RewriteRule (.*) $1?%1:%2