Forum Discussion
nassahla_65866
Nimbostratus
May 29, 2010I Rule Help
Hello all, i am trying to come up with an irule that will help us accomplish the following, a redirect from http to https, and additionally i also need to have a redirect on a url for example https://abc.com/123 being redirected to https://abc.com/123/login.do inorder words i dont want my the client having to type /login.do when they access the site. Here is an attempt on my part my on i my on the right track....thanks in advance...
when {HTTP::request {
if { ([HTTP::host] eq "abc.com") && (HTTP::uri] eq"/123/" } {
HTTP::redirect "https://abc.com/123/login.do
}
}
- The_Bhattman
Nimbostratus
Hi Nassahla,when HTTP_REQUEST { HTTP::redirect "https://[HTTP::host]/[HTTP::uri]" }
when HTTP_REQUEST { if { ([HTTP::host] eq "abc.com") and ([HTTP::uri] eq "/123") } { HTTP::redirect "https://[HTTP::host]/[HTTP::uri]/login.do" } }
- The_Bhattman
Nimbostratus
Hi Nassahla,when HTTP_REQUEST { HTTP::redirect "https://[HTTP::host]/[HTTP::uri]" }
when HTTP_REQUEST { if { ([HTTP::host] eq "abc.com") and ([HTTP::uri] eq "/123") } { HTTP::redirect "https://[HTTP::host]/[HTTP::uri]/login.do" } }
- The_Bhattman
Nimbostratus
Hi Nassahla,when HTTP_REQUEST { HTTP::redirect "https://[HTTP::host]/[HTTP::uri]" }
when HTTP_REQUEST { if { ([HTTP::host] eq "abc.com") and ([HTTP::uri] eq "/123") } { HTTP::redirect "https://[HTTP::host]/[HTTP::uri]/login.do" } }
- nassahla_65866
Nimbostratus
Thanks Bhatman, is it imperative to have 2 virtuals one configured for an http and the other for https or can i just have use the one i have already which is configured for https then do the redirect based on that .. ? - The_Bhattman
Nimbostratus
Hi Nassahla, - nassahla_65866
Nimbostratus
Hello all- i try putting the following in an i-rule editor then checking the syntax, it seems to be throwing errors at me what i my missing here ?... or is it ok to ignore the i-rule editor forcing about the syntax i am getting it on line all 3 lines... - The_Bhattman
Nimbostratus
I believe you are missing some braceswhen HTTP_REQUEST { If { match something.... } { Do something... } }
- L4L7_53191
Nimbostratus
If the rule you've pasted above is the actual rule, you're missing some curly brackets and an open parenthesis. Also watch your cases - iRules are case sensitive (http::host isn't valid, but HTTP::host is). It should look something like this:when HTTP_REQUEST { if { ([HTTP::host] eq "xxx.com") and ([HTTP::uri] eq "/xxx") } { HTTP::redirect "https://[HTTP::host]/[HTTP::uri]/login.do" } }
- nassahla_65866
Nimbostratus
sweet thanks for the pointers...
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