Forum Discussion
Poonam_Dronamra
Nimbostratus
Dec 06, 2006Irule Redirect Issue
I am trying to redirect the host portion to another URL
http://2007pece.mpiweb.org redirected to
http://www.mpiweb.org/cms/mpiweb/pece2007/pecetemplate.aspx?id=7390
and http://20007cmme.mpiweb.org redirected to http://www.mpiweb.org/cms/mpiweb/cmme2007/cmmetemplate.aspx?id=7432
and the following iRule is applied but does not perform the redirection
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if {[HTTP::host] contains "2007pece"} {
HTTP::redirect "http://www.mpiweb.org/cms/mpiweb/pece2007/pecetemplate.aspx?id=7390"
} elseif {[HTTP::host] contains "2007cmme"} {
HTTP::redirect "http://www.mpiweb.org/cms/mpiweb/cmme2007/cmmetemplate.aspx?id=7432"
}
}
Please could someone let me know what is wrong with the syntax.
I would really appreciate it.
Thank you very very much.
-Poo
3 Replies
- Poonam_Dronamra
Nimbostratus
I have also tried the following with no positive results. - The most obvious question first: have you applied this iRule as a resource to the virtual server you are passing traffic through?
when HTTP_REQUEST { set host [string tolower [HTTP::host]] log local0. "URI: '[HTTP::uri]'" log local0. "Host: '[HTTP::host]', lc -- '$host'" if {$host contains "2007pece"} { log local0. "$host contains '2006pece'" HTTP::redirect "http://www.mpiweb.org/cms/mpiweb/pece2007/pecetemplate.aspx?id=7390" } elseif {$host contains "2007cmme"} { log local0. "$host contains '2007cmme'" HTTP::redirect "http://www.mpiweb.org/cms/mpiweb/cmme2007/cmmetemplate.aspx?id=7432" } else { log local0. "$host didn't match any filtering criteria" } }
- Poonam_Dronamra
Nimbostratus
Thank you very very much for your help.
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