Forum Discussion
F5Hopper_28651
Nimbostratus
Sep 20, 2012string tolower? and HTTPS redirects
I have a few rules like this..
when HTTP_REQUEST {
if { [HTTP::uri] eq "/Recovery.aspx" } {
HTTP::redirect "https://qa.www.google.com/Recovery.aspx"
}
}
when HTTP_REQUEST {
if { [HTTP::uri] eq "/Signup.aspx" } {
HTTP::redirect "https://qa.www.google.com/Signup.aspx"
}
}
my issue is if I use a string tolower command it doesnt redirect to https://, Im trying to make it so the users changes the URL to /signup.aspx that it also redirects to HTTPS://
my other question is can I group these rules together?
Thanks
2 Replies
- Mohamed_Lrhazi
Altocumulus
Merge the two iRules by simply moving on 'if" block into the othe rule.
You should post the code of your iRule does not work, so people can see how you are using the tolower function. - F5Hopper_28651
Nimbostratus
ok thanks I have made my rule and its working now.
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] eq "/application.aspx" } {
HTTP::redirect "https://qa.www.google.com/Application.aspx"
}
if { [string tolower [HTTP::uri]] eq "/customerportal.aspx" } {
HTTP::redirect "https://qa.www.google.com/Login.aspx"
}
if { [string tolower [HTTP::uri]] eq "/login.aspx" } {
HTTP::redirect "https://qa.www.google.com/Login.aspx"
}
if { [string tolower [HTTP::uri]] eq "/recovery.aspx" } {
HTTP::redirect "https://qa.www.google.com/Recovery.aspx"
}
if { [string tolower [HTTP::uri]] eq "/signup.aspx" } {
HTTP::redirect "https://qa.www.google.com/Signup.aspx"
}
if { [string tolower [HTTP::uri]] eq "/activateaccount.aspx" } {
HTTP::redirect "https://qa.www.google.com/ActivateAccount.aspx"
}
}
it ended up that in my-
if { [string tolower [HTTP::uri]] eq "/activateaccount.aspx" } {
I had used the real URI of "/ActivateAccount.aspx", this line needed to be lowercase in order to work.
Now is there any way of making the HTTP::redirect more generic? so I can use it for other sites in DEV...so https://dev1.www.google.com?
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