Forum Discussion
Sulabh_Srivasta
Cirrus
Feb 04, 2025Need assistance on iRule or policy to redirect
Hello All, Please assist me either using the iRule or policy for the following requirement where the URI www.abc.com/mywork/variable?REQUEST=Getfiles/ should redirect to www.abc.com/capfiles/vari...
Paulius
MVP
Feb 04, 2025Sulabh_Srivasta The second redirect should work with the following iRule but your first one will not work because the F5 doesn't see anything beyond the "?" in the URI.
when CLIENT_ACCEPTED priority 500 {
set DEFAULT_POOL [LB::server pool]
}
when HTTP_REQUEST priority 500 {
set HOST [string tolower [HTTP::host]]
set URI [string tolower [HTTP::uri]]
if { ${HOST} eq "www.abc.com"} {
if {${URI} starts_with "/mywork/"} {
HTTP::uri [string map {"/mywork/" "/PRQS/LMN/mywork/"}[HTTP::uri]]
}
} else {
pool $DEFAULT_POOL
}
}
- Sulabh_SrivastaFeb 04, 2025
Cirrus
Thanks for you response, I need a redirect rule/policy for the first one as well.
- PauliusFeb 04, 2025
MVP
The first one can't have one for the reason I outlined in my comment above.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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