Forum Discussion
Eric_Frankenfie
Nimbostratus
Jun 25, 2010HTTP Redirects
I am new to iRules and going through baptism by fire.
I would like the following URLs: http://www.qa.ipcws.fiserv.com, http://qa.ipcws.fiserv.com, https://www.qa.ipcws.fiserv.com, https://qa.ipcws.fi...
Eric_Frankenfie
Nimbostratus
Jun 25, 2010I believe this did the trick for my VS listening on 443
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "www.qa.ipcws.fiserv.com" } {
HTTP::redirect "https://qa.ipcws.fiserv.com/cws.web/Login.aspx"
}
if { [string tolower [HTTP::host]] equals "qa.ipcws.fiserv.com" } {
HTTP::redirect "https://qa.ipcws.fiserv.com/cws.web/Login.aspx"
}
}
I then created a second VS listening on port 80 and configured this iRule
when HTTP_REQUEST {
if { [TCP::local_port] == 80 }{
HTTP::redirect "https://[getfield [HTTP::host] ":" 1][HTTP::uri]"
}
}
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