Forum Discussion
Bob_66655
Nimbostratus
Oct 10, 2018F5 host header rewrite different domain
Im trying to do rewrite of https://abc.com/code/* to https://xyz.com/*
when HTTP_REQUEST {
if { [HTTP::host] contains "abc.com" && [HTTP::uri] starts_with "/code" }
{
HTTP::header replace Host "xyz.com"
HTTP::uri [string map {"/code" ""} [HTTP::uri]]
}
}
}
But it seems to be failing with bad request,am I trimming too much of uri?
Bob
- Lee_Sutcliffe
Nacreous
Your iRule looks fine and the string map logic is correct - I've tested it nativity in TCL:
% set uri /one/two/three /one/two/three % set new [string map {"/one" ""} $uri] /two/three
If you are receiving a bad request from the pool member - it maybe that the new URI is incorrect and the web server is unable to process it.
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