Forum Discussion
PSritaC
Feb 19, 2020Altostratus
Redirection iRule Request for subsites
Hello I am pretty new to F5 and would like to see if someone can help me with a redirection iRule. The redirection should retain path after the second location or the subsites. So I am lookin...
PeteWhite
Feb 22, 2020Employee
So if you want to do this programmatically then you need to retrieve the parts of the path. To do that, use the command [ getfield [HTTP::path] "/" <field number> ] getfield HTTP::path. You can also use the tcl split command to split the path into a list and check the list contents with lindex
Seems pretty simple - the pseudocode would be:
if field 2 == "sites"
if field 3 != ""
then Host = field 3.blahblah.com
endif
if field 4 != ""
then new URI = /field3
endif
redirect to $Host$URI
else
redirect to other page
endif
Hopefully you can work it out from this
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