Forum Discussion
SV2022
Sep 16, 2022Cirrus
IRULE - redirect URI
my requiremnet is if URI is something like /business/car/truck it shoud look for the "business " and change it as /company/car/truck.. $Path_proxy= company when HTTP_REQUEST { set http_hostname [g...
- Sep 16, 2022
Is this more or less what you're iRule looks like?
when HTTP_REQUEST { set Path_proxy "/company/" set http_hostname [getfield [HTTP::host] : 1] set name [class match -value -- $http_hostname equals /DG_Test_i] set lname [class match -value -- $Envname equals /DG_Test_i] set proxy [class match -value -- $Poolname equals /DG_Test_i] log local0. " name is $name " log local0. " lname is $lname " log local0. " proxy is $proxy " if { [HTTP::uri] starts_with "/business" } { HTTP::uri [string map [list "/business/" ${Path_proxy}] [HTTP::uri]] } }
Kevin_Stewart
Employee
Try the string map with a list instead:
HTTP::uri [string map [list "/business/" ${Path_proxy}] [HTTP::uri]]
SV2022
Sep 16, 2022Cirrus
Hi kevin,
its not accepting the arguments
error: [wrong # args][string map [list "/business" ${Path_proxy}][HTTP::uri]]
/common/Test_api:13: error: [command is not valid in the current scope][}]
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects