Forum Discussion
Ahmad_03_151082
Nimbostratus
Mar 24, 2015Http to Https except specific URLs
Dears,
I am facing an issue with iRules i have created below iRule when HTTP_REQUEST { HTTP::redirect https://[getfield [HTTP::host] ":"][HTTP::uri] } to redirect from http://abc.com to https://abc.com now i need to Exclude some URLs like http://abc.com/xyz http://abc.com/example1 http://abc.com/example2
22 Replies
- nitass
Employee
can you please tell me if i want to exclude another URLs how the iRule will be?
e.g.
irule [root@ve11c:Active:In Sync] config tmsh list ltm rule qux ltm rule qux { when HTTP_REQUEST { switch -glob [string tolower [HTTP::host][HTTP::uri]] { "oservices.bahrain.bh/pubportal/insurancedetailsuploadws/services/insuranceuploadimpl*" - "something.domain.com/*" - "somethingelse.somedomain.com/*" { Do nothing } default { HTTP::respond 302 location "https://[HTTP::host][HTTP::uri]" } } } } test [root@ve11c:Active:In Sync] config curl -I http://oservices.bahrain.bh/pubportal/insurancedetailsuploadws/services/insuranceuploadimpl/something HTTP/1.1 404 Not Found Date: Thu, 23 Apr 2015 14:03:31 GMT Server: Apache/2.2.3 (CentOS) Last-Modified: Sun, 09 Feb 2014 08:39:51 GMT ETag: "41879c-59-2a9c23c0" Accept-Ranges: bytes Content-Length: 89 Content-Type: text/html; charset=UTF-8 [root@ve11c:Active:In Sync] config curl -I http://oservices.bahrain.bh/something HTTP/1.0 302 Found location: https://oservices.bahrain.bh/something Server: BigIP Connection: Keep-Alive Content-Length: 0 [root@ve11c:Active:In Sync] config curl -I http://www.domain.com HTTP/1.0 302 Found location: https://www.domain.com/ Server: BigIP Connection: Keep-Alive Content-Length: 0 [root@ve11c:Active:In Sync] config curl -I http://www.domain.com/something HTTP/1.0 302 Found location: https://www.domain.com/something Server: BigIP Connection: Keep-Alive Content-Length: 0- nitass
Employee
what do you mean?
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