Forum Discussion
Hien_Truong
Cirrus
May 21, 2021irule with default redirect to home page.
i have irule with redirect some uri and the rest of them redirect to the Home page. i don't know why it is not go to home page. i appreciate your help. Thanks when HTTP_REQUEST { if { [HTTP...
Hien_Truong
Cirrus
May 24, 2021Hi Enes;
i appreciate for your reply, i tried to change both # 301 or #302 in my irule, when typing www.ABC.com, it redirect to www.CDF.com (that's good) but when i type www.ABC.com/#about for example, it will redirect to www.CDF.com/#about. we want the rest of them go to home page www.CDF.com only (beside of /Content and /Programs). Any input i appreciate it.
Thanks
spalande
Nacreous
May 25, 2021Considering your VIP is hosting many applications and this rule should only be applied for www.abc.com HOST. You can try the below iRule
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
switch -glob [string tolower [HTTP::host]] {
"www.abc.com" {
if {$uri starts_with "/content" or $uri starts_with "/programs" } {
HTTP::respond 301 Location "https://www.cdf.com/legacy[HTTP::uri]"
} else {
HTTP::respond 301 Location "https://www.cdf.com"
}
}
default {
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
