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 01, 2007Historic F5 Account
Sure, then, that's pretty straightforward:
Create a class list containing your request and redirect details in 2 columns, separated by a space -- hostname/firstdir in one, then the redirect target in the other.
class myRedirects {
"www.thermo.com/histology http://www.thermo.com/.../0,2152,53,00.html"
"www.whatever.com/dir1 http://newhost/newuri"
}Then create this iRule an apply to the virtual server:
rule URIredirects {
when HTTP_REQUEST {
set req "[HTTP::host]/[getfield [HTTP::uri] "/" 2]"
set redir [findclass $req $::myRedirects]
if {$redir !=""}{
HTTP::redirect $redir
}
}
}/deb
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