Forum Discussion
charlestips_149
Nimbostratus
Jun 30, 2010http to https redirect except for specific URL
We currently have a wildcard cert and virtual server setup so that anyone trying to go to http://www.domain.com/directory gets redirected to https://www.domain.com/directory simple enough
wh...
Michael_Yates
Nimbostratus
Jul 06, 2010You could do it this way:
when HTTP_REQUEST {
if { [HTTP::host] equals "www.domain.com" } {
if { [string tolower [HTTP::uri]] starts_with "/directory" } {
pool pool.of.servers.to.service.request
}
else {
HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri]
}
}
If the Virtual Server is only used to service things for "www.domain.com" then you could clean it up even more:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "/directory" } {
pool pool.of.servers.to.service.request
}
else {
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