Forum Discussion
wctwf_78814
Nimbostratus
Feb 09, 2009Validation of iRule HTTPS::REDIRECT
Totally blank on the scripting side of things so here is the scenario for which iRule needs to be written. Looking for some insight here as to what's the logic to apply here.
Situation Given:
----------------
website: www.ensynch.com
Create iRule: HTTPS REDIRECT the above website to https://www.ensynch.com/test/
Below is what I came up with base on published solution on the forum as the sample iRules:
rule company.com_https_redirect {
when HTTP_REQUEST {
HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
}
WOULD LIKE TO KNOW IF THERE IS ANYTHING WRONG WITH THE above created iRule or syntax or logic.
Appreciate your input as I am still trying to get around the various syntax & TCL tit bits.
WCTWF
- The_Bhattman
Nimbostratus
I suppose you can write it like the followingwhen HTTP_REQUEST { if {([HTTP::host] eq "www.ensynch.com") && ([HTTP::uri] ends_with "/") } { HTTP::redirect "[HTTP::host]/test" } }
- wctwf_78814
Nimbostratus
CB, - lmwf1_55268
Nimbostratus
The control operators are && (read as AND) and || (read as OR). The syntax for AND list is as follows - hoolio
Cirrostratus
Also, you mention that the requests are being made over HTTPS. In order to view/modify the HTTP content on LTM, you will need to decrypt the SSL with a client SSL profile.
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