Forum Discussion
Help with an I-rule rewrite
Thanks for the response. I needed it to work with *.api-np-c.newapps.com and *api-gw-np-a.newapps.com. I got it working with this, finally. I had the endPos wrong initially. It needed to be +8 not +11:
when HTTP_REQUEST {
if {[HTTP::uri] starts_with "/" } {
HTTP::uri /[HTTP::host][HTTP::uri]
}
switch -glob [HTTP::host] {
"*.api-np-c.regionsapps.com*" {
set http_host [HTTP::host]
set startPos [string first .api-np-c $http_host]
set endPos [expr $startPos + 8]
set http_host [string replace $http_host $startPos $endPos .api-gw-np-a]
HTTP::header replace Host "$http_host"
}
}
}
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