Forum Discussion
JackYates_39764
May 08, 2011Nimbostratus
https redirection Irule on https virtual server
I'm trying to work out a way to re-direct an https request to another https URL.
Link comes in as https;//oursite.com
I have an IRule on the HTTP Virtual server that converts http://oursite.com over to https://oursite.oursite.com/abc and that works fine.
But if I do https://oursite.com it does not get converted. I have tried applying the same IRule to the HTTPS Virtual server but that is not working.
The IRule looks like this.
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
if { ( ($host starts_with "oursite.com") or ($host starts_with "www.oursite.com")) } {
HTTP::redirect "https://oursite.oursite.com/abc"
}
}
Thanks! Jack.
- JackYates_39764NimbostratusOk, I think I found the issue we are having. Pretty silly thing, which is probably why no one responded to my topic. :)
- Michael_YatesNimbostratusGlad to hear that you fixed your problem. No real way around the problem you encountered without splitting this (www and non-www) onto different Virtual Servers.
- hooleylistCirrostratusRFC2616 states the host header value must be considered without case sensitivity. All modern browsers set the Host to lowercase before sending the request. However, custom clients might not. Therefore, we generally set the host to lowercase before comparing it to ensure the iRule is following RFC2616.
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