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
Jul 31, 2014Perhaps this:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] ends_with "myownwork.com" } {
HTTP::redirect "http://www.yourwork.com"
} elseif { not ( [string tolower [HTTP::host]] starts_with "www." ) } {
if { [class match [string tolower [HTTP::host]] equals domlist] } {
host in the list - issue redirect to parent URL
HTTP::redirect "http://www.yourwork.com"
} else {
host not in data group - redirect to self and add www.
HTTP::redirect "http://www.[HTTP::host][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