Forum Discussion
Brantly_Perry_1
Nimbostratus
Sep 03, 2008Redirect only parially working...
Hello, I'm new to this forum, and also new to iRules. Just wanted to run a rule by some of you more seasoned iRule experts.
when HTTP_REQUEST {
if { [HTTP::path] eq "/" }{
HTTP::redirect "https://www.mynurseonline.com/member/"
} elseif { [HTTP::host] eq "mynurseonline.com" }{
HTTP::redirect "https://www.mynurseonline.com/member/"
}
}
This first part of the iRule works great, but the second part doesn't work at all. The certificate is registered to www.mynurseonline.com. If a user just puts in mynurseonline.com they get a certificate error, so I'm trying to do this redirect. Not sure I'm going about it the right way or not. Like I said, I'm new to iRules! Let me know if you think I could do anything better. Thanks so much!
8 Replies
- Colin_Walker_12Historic F5 AccountIs the redirect actually not working? I.E. they're not getting to www.mynurseonline.com? Or is it just that they're still getting the security error?
- hoolio
Cirrostratus
You could get a new cert using Subject Alternate Names which is valid for example.com and www.example.com. For more info on this, try searching the 9.x iRules forum for "san cert" or "subject alternate name". - Brantly_Perry_1
Nimbostratus
Thanks to both of you for your quick responses! - hoolio
Cirrostratus
Do you get a TCL error in /var/log/ltm when the second redirect doesn't work? What response does the client get from the VIP? Is it a TCP reset or some kind of HTTP response? If you test with Fiddler for IE or LiveHttpHeaders for Firefox, you can see if there is an HTTP response. Also, can you add logging to the rule so you can see if it's being triggered as you expect?when HTTP_REQUEST { if { [HTTP::path] eq "/" }{ HTTP::redirect "https://www.mynurseonline.com/member/" log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::path] matched path /" } elseif { [HTTP::host] eq "mynurseonline.com" }{ log local0. "[IP::client_addr]:[TCP::client_port]: [HTTP::path] matched host: mynurseonline.com" HTTP::redirect "https://www.mynurseonline.com/member/" } }
- Brantly_Perry_1
Nimbostratus
Thanks Aaron. I'm definitely am doing something wrong. Here's the outpug from logging on the iRule: - hoolio
Cirrostratus
Do you have another iRule added to the VIP or an HTTP class which is redirecting the client? If so, can you post that rule? - Brantly_Perry_1
Nimbostratus
Hi Aaron. I started logging on my DMZ facing BigIP and received a similar error: - Brantly_Perry_1
Nimbostratus
I don't believe I've seen this error until now:
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