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
Try this:
when HTTP_REQUEST { if { [string tolower [HTTP::host]] eq "example" } { HTTP::redirect "https://example.com/test" } }
- KJ_50941Jun 26, 2014NimbostratusI try that before not working, I am wondering if that needs to be done on the server site?
- Cory_50405Jun 26, 2014NoctilucentIf the exact HTTP host they are trying to access is "example", then the iRule will work. This assumes that you are terminating SSL on this virtual server and have an HTTP profile applied to the virtual server. Otherwise, you won't have the visibility into the layer 7 HTTP data in order to do the comparison.
- KJ_50941Jun 26, 2014Nimbostratuswe have two hosts behind 443 VIP with SSL termination , requirement is if user type https://example must to resolved to FQN--> https://example.com/test. if I type https://example.com it will redirect fine to /test. is just short name ( example) doesn't work. sorry for long explanation.
- Cory_50405Jun 26, 2014NoctilucentIs your DNS environment configured correctly to resolve 'example'? It should either resolve to the same IP address as 'example.com', or CNAME to 'example.com'.
- KJ_50941Jun 26, 2014NimbostratusI did tcpdump and I notice I am not seeing any packet to VIP, but if I use FQDN I see 3 way handshake. not sure DNS part, if I type shortname it resolves to same as FQDN
- Cory_50405Jun 26, 2014NoctilucentPerform these tests: nslookup example nslookup example.com Do these two resolve to the same IP address? If so, is this IP address your virtual server IP (or does it get translated via NAT to your virtual server IP)? Are you using any other controls (ASM, local traffic policies) that may not be allowing access to the virtual server by just the shortname?
- KJ_50941Jun 26, 2014Nimbostratusif I do nslookup for "example" it display as below: address:192.168.1.10 aliases:example.com for example.com--> address:192.168.1.10 aliases:example.com 192.168.1.10 is F5 VIP for example.com and we don't have any ASM or firewall to block. I am guessing something might miss configured on server site.
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