Forum Discussion
Check and replace query string parameter called site for google GSA
I need some help writing an iRule for checking valid values for the parameter site and replace the value with empty-collection if the value does not match www-public-1, www-sec-1, www-sec-2.
when HTTP_REQUEST { switch -glob [string tolower [URI::query "?[HTTP::query]" site]] { If site parameter value matches www-public-1, www-sec-1 and www-sec-2, then no modifications "www-public-1" - "www-sec-1" - "www-sec-2" { HTTP::uri } If no match above then use site=empty-collection I do not know how to change value of site while maintaining the rest of the parameters default { HTTP::uri assign_string } } }
1 Reply
- eugeneK_pdx
Nimbostratus
I got this to work with following: when HTTP_REQUEST { set site_param_value [string tolower [URI::query "?[HTTP::query]" site]] switch -glob $site_param_value { "www-public-1" { HTTP::uri } "www-sec-1" { HTTP::uri } "www-sec-2" { HTTP::uri } default { HTTP::uri [string map {"site=$site_param_value" "site=empty-collection"} [HTTP::uri]] } } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com