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
what we would like to do is not redirect for a specific directory.
So redirect for all parts of www.domain.com unless a user goes to http://www.domain.com/specialdirectory
How can I modify the standard http to https irule for that, or should there be a specific irule added for just this.
11 Replies
- Michael_Yates
Nimbostratus
You 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