Forum Discussion
Anush
Nimbostratus
Mar 02, 2015Data group "/" definition
Hi Experts,
Thanks in advance for your time and respond to this question.
I have request to redirect couple of URLs to specific site.
https://abc.com/ or
https://abc.com/uri1 or
http...
Michael_Jenkins
Cirrostratus
Mar 02, 2015I think you're best bet if you want to use a data group would be to put the source host and uri as the name and then the redirect host (& uri) as the value. Then, in your irule you would just use the class command to search the datagroup for the host and uri. Something like this might work. (Note: it will ignore your protocol, so you'd only be checking on
abc.com instead of http://abc.com. Need to be sure you enter the data group items in based on that.)
when HTTP_REQUEST {
set key [string tolower "[HTTP::host][HTTP::uri]"]
if { [class match $key equals DATA_GROUP_NAME] } {
HTTP::respond 302 [class match -value $key equals DATA_GROUP_NAME]
return
}
}
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