Forum Discussion
pipo_112511
Altostratus
May 07, 2007Redirect Https
Hello,
I'm brand new on Irules,
I like to know if it's possible to redirect something like that :
https://www.f5.com
to
https://www.f5.com/webpage
Thanks in advance
7 Replies
- Kevin_Stewart
Employee
when HTTP_REQUEST {
if {HTTP::uri eq "/"}{
HTTP::redirect http://[HTTP::host]/webpage
}
} - pipo_112511
Altostratus
Tanks Kevin,
But i've got this error message when i tried to create it
01070151:3: Rule [tma] error:
line 2: [parse error: PARSE syntax 28 {syntax error in expression "HTTP::uri eq "/"": variable references require preceding $}] [{HTTP::uri eq "/"}] - Kevin_Stewart
Employee
Sorry, I didn't review my own post. Try this:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
HTTP::redirect "/webpage"
}
} - JRahm
Admin
You need brackets around the HTTP::uri in the if conditional:
when HTTP_REQUEST {
if { [HTTP::uri] eq "/" } {
HTTP::redirect http://[HTTP::host]/webpage
}
} - pipo_112511
Altostratus
Hi,
it worked fine over http but not with https why??????? - Marcus_Slawik_8Historic F5 AccountThierry,
do you use HTTPS in the initiating request or do you want to redirect port 80 to 443? Do you use the BigIP for decryption?
schwiddy - Vaikunt_Krishna
Nimbostratus
This is the rule I use for HTTPS Redirect
when HTTP_REQUEST {
set userhost [HTTP::host]
HTTP::redirect "https://$userhost[HTTP::uri]"
}
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
