Forum Discussion
Ankur_5273
Nimbostratus
Jul 30, 2014Create 2 different iRules for Redirection
Hi Experts,
In below irule1 , www. gets added to the beginning of the URI , with few exceptions
when HTTP_REQUEST {
if {not ([HTTP::host] starts_with "www") and not ([HTTP::host] equals "myo...
Kevin_Stewart
Employee
Aug 04, 2014Okay, this should be closer to your description:
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::host]] ends_with my_uri_dg] } {
in the data group
HTTP::respond 302 Location "http://www.yourwork.com"
} else {
not in the data group
if { not ( [string tolower [HTTP::host]] starts_with "www." ) and not ( [string tolower [HTTP::host]] starts_with "myworkplace" ) } {
not in datagroup, not start with www and not start with myworkplace
HTTP::redirect "http://www.[HTTP::host][HTTP::uri]"
} else {
doesn't match any conditions
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