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...
Ankur_5273
Nimbostratus
Aug 01, 2014Hi Kevin
The above doesnot work as per my requirement . I will give a quick recap again . Any URL falling under data group whether with "www" or without "www" should get redirected to parent URL http://www.yourwork.com . But any Other URL (not falling under data group and NOT starting with www , as well as not beginning with "myworkplace") should have just "www" append at the begining of the URL
I have modified your previous iRule as follows , please check this if it makes sense and also help in correcting the syntax :
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] starts_with "www." } {
if { [class match [string tolower [HTTP::host]] equals domlist] } {
host in DG list but user types full URL www.myownwork.com - issue redirect to parent URL
HTTP::redirect "http://www.yourwork.com"
} elseif { not ( [string tolower [HTTP::host]] starts_with "www." and not ([string tolower[HTTP::host]] starts_with "myworkplace") } {
if { [class match [string tolower [HTTP::host]] equals domlist] } {
host in DG list but user doesnt type full URL myownwork.com - 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]"
}
}
}
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