Forum Discussion
Sivaraj_6072_25
Nimbostratus
Apr 01, 2016iRule Redirection
Hi,
I am new to iRule section.
I have an iRule for http to https redirect and applied to a virtual server, So any traffic coming through my virtual server will be redirected to https.
when HTTP...
Hannes_Rapp_162
Nacreous
Apr 02, 2016when HTTP_REQUEST {
if { ([string tolower [HTTP::host]] ends_with "oldsite.com") && ([HTTP::path] eq "/") } {
Intercept with a redirect to http://www.newsite.com
HTTP::respond 301 Location "http://www.newsite.com/" Connection Close
} elseif { ([string tolower [HTTP::host]] ends_with "oldsite.com") && ([HTTP::path] ne "/") } {
Forward traffic to HTTP pool
pool NameOfMyHTTPpool80
} else {
Generic HTTP to HTTPS redirect (ORIGINAL request Host and URI are retained)
HTTP::respond 301 Location "https://[HTTP::host][HTTP::uri]" Connection Close
}
}
Hannes_Rapp_162
Nacreous
Apr 02, 2016Perhaps a conflict with another iRule? Do you see anything in /var/log/ltm ? Also, please provide output for your VS config: 'tmsh list ltm virtual YourVSName'
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