Forum Discussion
leozh_54300
Nimbostratus
Jan 08, 2010HTTP::Redirect Question
I am trying to make an iRule that does an HTTP::Redirect as follows:
when HTTP_REQUEST {
if { [HTTP::host] equals"subdomain.xxxxx.com"} {
HTTP::redirect "http://subdomain.xxxxx.com/parameter?yyyy=ZZ"
}
}
Does the question mark in the URL have to be escaped or should it be ok as is?
Thanks!
- The_Bhattman
Nimbostratus
Hi Leozh, - hoolio
Cirrostratus
You'll need to add a space between equals and "subdomain.xxx.com". And if this iRule is added to the HTTP virtual server, you might want to add a check for the path. Else I think you'll get an infinite loop of redirects to http://subdomain.xxxxx.com/parameter?yyyy=ZZ.when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "subdomain.xxxxx.com" && [HTTP::path] eq "/"} { HTTP::redirect "http://subdomain.xxxxx.com/parameter?yyyy=ZZ" } }
- leozh_54300
Nimbostratus
Thanks for the help! That worked.
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