Forum Discussion
iRule to add www without changing URL
- Jul 05, 2019
Do you want to change Host header sent from the client in server side connection or do you want to redirect the client to https://WWW.abc.com/testfolder/blahblahblah
to redirect the client, use following code
when HTTP_REQUEST { if {[HTTP::host] eq "abc.com"} { HTTP::redirect "https://www.abc.com[HTTP::uri]" } }
The order in which the irule was placed on the F5 was the issue. After moving the irule to the bottom of the list, it worked! Thanks everyone!
If you have more than one iRule on a VIP I would seriously recommend using priorities on your events. This way you can control the ordering of your events rather than relating on list ordering which is not ideal.
https://devcentral.f5.com/s/articles/the101-irules-101-events-amp-priorities
when HTTP_REQUEST priority 100 {
#this event will fire SECOND
}
when HTTP_REQUEST priority 10 {
#this event will fire FIRST
}
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