Forum Discussion
Nicolas_Bellen1
Jun 03, 2011Nimbostratus
REGEX Alternatives
I've been trying to figure out how i'd structure a particular portion of my iRule to look for values contained in a string, instead of a regular expression but i'm having some difficulty:
Th...
Nicolas_Bellen1
Jun 03, 2011Nimbostratus
Aaron,
I tried using URI::host but it didn't give me the expected results. Here's what i have:
if { [HTTP::is_redirect] } {
set url [HTTP::header value Location]
set host [URI::host $url]
log local0. "Original Location: [HTTP::header value Location]"
HTTP::header replace Location [string map -nocase {$host "def.example.com"} [HTTP::header value Location]]
log local0. "Updated Location: [HTTP::header value Location]"
}
In the logs i am seeing no change. To answer your previous question, i'd like to match the host portion of anything in the header upon a redirect and swap it out with "def.example.com"
Nick
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