Forum Discussion
Steve_Brown_882
Mar 14, 2007Historic F5 Account
Newbie Question URI Rewrite
Hello All,
I am in need of some help with an irule to rewrite a uri and uri redirects. I have a url which is https://prepend-host.domain.com/whatever and I would like to rewrite this inbound to b...
Steve_Brown_882
Mar 15, 2007Historic F5 Account
Actually I have this working in a very dirty mannor with these two rules and a stream profile. However I could use some help with cleanning these up so that I am not replacing with hardcoded data.
when HTTP_REQUEST {
if {[HTTP::host] contains "prefix-"} {
HTTP::header replace "Host" "subhost.host.com"
log local0. "This is the new host: [HTTP::header "Host"]"
}
}
when HTTP_RESPONSE {
if {[HTTP::header "Location" ] starts_with "https://subhost."} {
HTTP::header replace "Location" "https://prefix-subhost.host.com/etc.asp"
log local0. "This is the new outbound host: [HTTP::header "Host"]"
}
}
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
