Forum Discussion
dyobbs_25515
Feb 03, 2012Nimbostratus
iRule to redirect a variable to http
Guys hi,
I'm newbie here. I wanted to create an iRule, that truncates the later part of the message from the "http://.acme.com" to http://
any help is appreciated.
Will t...
nitass
Feb 03, 2012Employee
can you post the question again? some text is missing because of devcentral's parser.
by the way, acme.com is not part of HTTP::uri. it is part of HTTP::host.
5-Minute iRules: What’s a URL?
http://devcentral.f5.com/weblogs/jason/archive/2010/09/29/5-minute-irules-whatrsquos-a-url.aspx
anyway, this is what i guess you are asking.
[root@ve1023:Active] config b virtual bar list
virtual bar {
destination 172.28.19.79:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[scan [HTTP::host] {%[^.].acme.com} first] == 1}{
HTTP::redirect "]"
}
}
}
[root@ve1023:Active] config curl -I http://test.acme.com/whatever
HTTP/1.0 302 Found
Location:
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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