on 02-20-2019 9:13 PM
Hello Everyone,
I currently have the following redirect rule in place which works as expected:
if %{HTTP_HOST} regimatch <host> [and]
if %{PATH} regimatch /SAP/BC/GUI/SAP/ITS/WEBGUI [and]
if %{QUERY_STRING} regimatch "~transaction=ZWFCA_LOGS"
RegIRedirectUrl ^/SAP/BC/GUI/SAP/ITS/WEBGUI(.*) https://<new Host>/SAP/BC/GUI/SAP/ITS/WEBGUI$1?%{QUERY_STRING}
I need to add another webgui transaction for the rule to hit on, so I updated above to:
if %{HTTP_HOST} regimatch <host> [and]
if %{PATH} regimatch /SAP/BC/GUI/SAP/ITS/WEBGUI [and]
if %{QUERY_STRING} regimatch "~transaction=ZWFCA_LOGS" [or]
if %{QUERY_STRING} regimatch "~transaction=CAT2"
RegIRedirectUrl ^/SAP/BC/GUI/SAP/ITS/WEBGUI(.*) https://<new Host>/SAP/BC/GUI/SAP/ITS/WEBGUI$1?%{QUERY_STRING}
This still works for the first query string but fails for the second. The match for HTTP_HOST and PATH are successful. The URL being parsed is:
http://<host>/sap/bc/gui/sap/its/webgui;~service=3200?%7etransaction=CAT2&%7enosplash=1&sap-client=0... Host>%3A7302%2Fsap%2Fpublic%2Fbc%2Fthemes%2F~client-010%2F~cache-VnncQw78IMPhPMkFLEe3MZNxPlI&sap-shell=FLP1.44.41
I have tried the following for the second query string as well:
if %{QUERY_STRING} regimatch "%7etransaction=CAT2"
and
if %{QUERY_STRING} regimatch "%7etransaction=CAT2(.*)"
Does anyone have any thoughts on how to properly form the second query string?
Thanks and regards,
Joe Hall
Hello Joseph,
I think that the second AND (linking "if %{PATH} regimatch" to the first query string) is breaking the logic of the possible conditions.
This is based on the following sentence of this help.sap.com page: "Unlike programming languages the operators here have equal precedence. Operators are processed from left to right."
I believe that you have to create two separate set of rules:
#First tcode to test
if %{HTTP_HOST} regimatch <host> [and]
if %{PATH} regimatch /SAP/BC/GUI/SAP/ITS/WEBGUI [and]
if %{QUERY_STRING} regimatch "~transaction=ZWFCA_LOGS"
RegIRedirectUrl ^/SAP/BC/GUI/SAP/ITS/WEBGUI(.*) https://<new Host>/SAP/BC/GUI/SAP/ITS/WEBGUI$1?%{QUERY_STRING
#Second tcode to test
if %{HTTP_HOST} regimatch <host> [and]
if %{PATH} regimatch /SAP/BC/GUI/SAP/ITS/WEBGUI [and]
if %{QUERY_STRING} regimatch "~transaction=CAT2"
RegIRedirectUrl ^/SAP/BC/GUI/SAP/ITS/WEBGUI(.*) https://<new Host>/SAP/BC/GUI/SAP/ITS/WEBGUI$1?%{QUERY_STRING
Regards,
Isaías
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.