Forum Discussion
lori_54451
Nimbostratus
May 01, 2007Using iruel for redirects
I just inherited a web hosting farm that is experencing issues contolling thier targeted urls within thier web application. They have been living with this issue in thier previous hosting site for 2-3...
Deb_Allen_18
May 03, 2007Historic F5 Account
ah, yes, I omitted the separator character from the findclass command. Without it, the entire row is returned; with it, only the portion after the first separator is returned.
This should work better:
rule URIredirects {
when HTTP_REQUEST {
set req "[HTTP::host]/[getfield [HTTP::uri] "/" 2]"
set redir [findclass $req $::myRedirects " "]
if {$redir !=""}{
log local0. "Redirecting request for [HTTP::host][HTTP::uri] to $redir"
HTTP::redirect $redir
}
}
}I also added a log line to assist in troubleshooting that logs the redirect value -- once you've got it working, delete that for production use./d
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