Forum Discussion
Arturo_G__Molin
Nimbostratus
Dec 20, 2012Redirect + datagroup
Hi,
I have a datagroup... for example
/prueba.com := /prueba.com/home
I have used HTTP::redirect and HTTP::respond 301 Location "..." and It doesn't work.
HTTP::respond...
What_Lies_Bene1
Cirrostratus
Jan 04, 2013Hey Arie. I wasn't aware of that, I hate to question you but are you sure that's still the case?
Updated iRule (untested) incorporating the check;
when HTTP_REQUEST {
Compare the request URI with the strings in the uri-dg data group
and populate the variable: redirect with the associated value if
there is a match
if { class exists dg_redirect } {
set redirect [class match -value [HTTP::uri] equals dg_redirect]
As long as our variable: redirect isn't empty, perform the redirect
if { $redirect ne "" } {
HTTP::redirect "http://[HTTP::host]$redirect"
}
If there wasn't a match and variable: redirect is empty, do something
else instead
else {
log local0. "No redirect occurred for: [HTTP::uri]"
}
}
}
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