Forum Discussion
Nicolas_MENOUX_
Nimbostratus
Apr 29, 2009STREAM_MATCHED for regexp replace ?
Hi,
I'm using an IRule to replace Http content coming from our web servers in order to change image relative path to absolute path as described below :
when HTTP_REQUEST ...
hoolio
Cirrostratus
Apr 30, 2009Just what you had in your original post:
when HTTP_REQUEST {
set host [HTTP::host]
}
You could add a check to see if the host value in the request was null and then use the VIP address or the public IP address if the VIP is an internal IP address:
when HTTP_REQUEST {
Check if the client used a host header
if {[string length [HTTP::host]}[
set host [HTTP::host]
} else {
Use the VIP address instead
set host [IP::local_addr]
}
}
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
