Forum Discussion
MihirP1129
Jul 03, 2019Nimbostratus
iRule to add www without changing URL
Hello F5 community, Is there a way to add www in front of the URL while keeping the URL intact? For example: https://abc.com/testfolder/blahblahblah changed to https://WWW.abc.com/testfolder/...
- 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]" } }
MihirP1129
Nimbostratus
Hi Lee, please see my response above of what I'm trying to accomplish.
Lee_Sutcliffe
Jul 05, 2019Nacreous
Have you tried your code? Reading your description above, it sounds like the iRule you supplied should work. Changing the incoming host header from abc.com to www.abc.com will leave the URi/Path intact
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