Forum Discussion
soda0091_86320
Nimbostratus
Apr 25, 2013Irule adding dns FQDN + appending url
I am using the iRule below to append a url to a VIP that is defined on our F5. Currently the output comes out as DNSshortname/url/url2. Our end user has requested that the URL show up using th...
nitass
Employee
Apr 25, 2013you may use HTTP::redirect.
HTTP::redirect wiki
https://devcentral.f5.com/wiki/iRules.http__redirect.ashx
e.g.
[root@ve10:Active] config b virtual bar list
virtual bar {
snat automap
pool foo
destination 172.28.19.252:80
ip protocol 6
rules myrule
profiles {
http {}
tcp {}
}
}
[root@ve10:Active] config b rule myrule list
rule myrule {
when HTTP_REQUEST {
if { [HTTP::host] equals "DNS" and [HTTP::uri] equals "/" } {
HTTP::redirect "http://DNS.mydomain.com/url/url2/"
}
}
}
[root@ve10:Active] config curl -I http://172.28.19.252/ -H "Host: DNS"
HTTP/1.0 302 Found
Location: http://DNS.mydomain.com/url/url2/
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
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