Forum Discussion
Need help with redirect iRule
I've setup two virtual server's, one intended for our mobile site (https://mobile.site.com), and another that uses the same IP for HTTP to HTTPS redirects (http://mobile.site.com). As of now, the HTTP version is using the pre-loaded iRule, _sys_https_redirect, but now have a more specific need.
Traffic requesting our HTTPS virtual server, https://mobile.site.com, needs to be redirected to https://mobile.site.com/User/MobileSiteStart/List
In addition, any traffic destined to the HTTP virtual server needs to get to that same location.
Unfortunately, I'm at a loss of how to accomplish this. Any help would be greatly appreciated.
Thanks!
Jeff B
15 Replies
- Mohamed_Lrhazi
Altocumulus
You are saying you have two http virtual servers for which: - Jeff_Bull_42197
Nimbostratus
That's correct. - Mohamed_Lrhazi
Altocumulus
You dont need to learn iRules or write them. - Jeff_Bull_42197
Nimbostratus
Are you referring to Traffic Classes, or something else? - Mohamed_Lrhazi
Altocumulus
click: Local Traffic ›› Profiles : Protocol : HTTP Class - Mohamed_Lrhazi
Altocumulus
Read: https://support.f5.com/kb/en-us/solutions/public/7000/200/sol7280.html?sr=24430710
sorry, maybe tis one a bit better intro: https://support.f5.com/kb/en-us/solutions/public/8000/000/sol8018.html?sr=24430734
- Mohamed_Lrhazi
Altocumulus
I think all you have to do in the class is set:
- Jeff_Bull_42197
Nimbostratus
Thanks for the help Mohamed! I'll read up, and go from there. - Jeff_Bull_42197
Nimbostratus
I created a new HTTP class that matches all, with the 'Send To' option set to 'Redirect To...' - nitass
Employee
this is httpclass.[root@ve10:Active] config b virtual bar80 list virtual bar80 { snat automap pool foo destination 172.28.19.79:80 ip protocol 6 httpclass myhttpclass profiles { http {} tcp {} } } [root@ve10:Active] config b virtual bar443 list virtual bar443 { snat automap pool foo destination 172.28.19.79:443 ip protocol 6 httpclass myhttpclass profiles { clientssl { clientside } http {} tcp {} } } [root@ve10:Active] config b profile myhttpclass list profile httpclass myhttpclass { defaults from httpclass pool none redirect "https://[HTTP::host]/User/MobileSiteStart/List" paths "/" } [root@ve10:Active] config curl -I http://172.28.19.79 HTTP/1.0 302 Found Location: https://172.28.19.79/User/MobileSiteStart/List Connection: Keep-Alive Content-Length: 0 [root@ve10:Active] config curl -Ik https://172.28.19.79 HTTP/1.0 302 Found Location: https://172.28.19.79/User/MobileSiteStart/List Connection: Keep-Alive Content-Length: 0
Recent Discussions
Related Content
* 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