Forum Discussion
adam21983_1462
Nimbostratus
Jan 18, 2013Simple URL Redirect Question
Hello Everyone,
Sorry if this is overly simple but I am driving myself crazy trying to get this to work. In the below iRule my redirect works if the request is sent to http://redirecttes...
nitass
Employee
Jan 18, 2013doesn't your original irule work??
[root@ve10:Active] config b virtual bar list
virtual bar {
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 { ([string tolower [HTTP::host]] equals "redirecttest.mysite.com") } {
HTTP::redirect http://google.com
}
if { ([string tolower [HTTP::host]] equals "www.redirecttest.mysite.com") } {
HTTP::redirect http://google.com
}
}
}
[root@ve10:Active] config curl -I http://redirecttest.mysite.com
HTTP/1.0 302 Found
Location: http://google.com
Server: BigIP
Connection: Keep-Alive
Content-Length: 0
[root@ve10:Active] config curl -I http://www.redirecttest.mysite.com
HTTP/1.0 302 Found
Location: http://google.com
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