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]" } }
To complicate things even more, I found out that the web developer has a redirect hardcoded in the code for http://abc.com or http://www.abc.com to go to https://www.abc.com/web/default.aspx. I added the redirect iRule (Stanislas Piron) mentioned above to the 443 VS on the F5, and when I test a site https://abc.com/web/default.aspx?frm=test-option3, I get a "Hmm.. can't reach this page" in firefox. It shows Protocol (Pending) and Result (Pending) when do a Network debugging in FF when hitting that site. The redirect in the code has to stay for the site to work properly. I'm not sure how to make this work. Maybe conflicts in multiple redirects? looping?
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