Forum Discussion
ha_34906
Altostratus
Nov 10, 2011change url via iRule
simple irule question, I been looking for an answer and cant find it so sorry if this was answered already.
I need an iRule that can repalce part of a url with another. Meaning if the reqeu...
nitass
Employee
Nov 10, 2011e.g.
[root@ve1023:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.65.152:http
ip protocol tcp
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve1023:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if {[HTTP::host] equals "www.abc.com"} {
HTTP::redirect "http://www.xyz.com[HTTP::uri]"
}
}
}
[root@ve1023:Active] config curl -IL http://www.abc.com/1234
HTTP/1.0 302 Found
Location: http://www.xyz.com/1234
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
HTTP/1.1 404 Not Found
Date: Fri, 11 Nov 2011 00:05:15 GMT
Server: Apache/2.2.3 (CentOS)
Connection: close
Content-Type: text/html; charset=iso-8859-1
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