Forum Discussion
KJ_50941
Jun 26, 2014Nimbostratus
irule redirect or rewrite
Hi
I need an irule to redirect from shortname: https://example to https://example.com/test
I used below irule , however shortname doesn't work, but if I type fully qualified domain works ju...
Cory_50405
Jun 26, 2014Noctilucent
It sounds like DNS is resolving as intended. Are you certain your iRule is matching on 'example'? Try putting a logging statement into the iRule and see if anything shows up in /var/log/ltm:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] eq "example" } {
log local0. "Matched example host, redirecting"
HTTP::redirect "https://example.com/test"
}
}
- KJ_50941Jun 30, 2014NimbostratusI put exact irule for logging, however I am not seeing it when accessing F5 VIP.
- KJ_50941Jun 30, 2014NimbostratusI did tecpdump , and I can only see it when I am using FQDN in my browser.nothing for short name. what does that mean? tcpdump -ni 0.0 host 192.168.110 and 172.16.1.10 192.168.1.10 is F5 vip and 172.16.1.10 is my pc. Thx
- Cory_50405Jun 30, 2014NoctilucentSo then is 'example' getting CNAME'd to example.com? Could be that this is the case, and when the HTTP request arrives at your LTM, the host header specifies example.com and the iRule won't match.
- Cory_50405Jun 30, 2014NoctilucentIf you aren't seeing traffic in the tcpdump when attempting to access https://example, then it seems like it isn't making it to your virtual server. Your capture syntax should be: tcpdump -nni 0.0 host 192.168.1.10 and host 172.16.1.10
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