Forum Discussion
Create 2 different iRules for Redirection
Hi 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]"
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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