Forum Discussion
iRule - Url rewrite and header replace and pool selection not working
Hi rct101
Can you try below one and let me know if it works ?
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"mywebsite.test.edu" {
switch -glob [string tolower [HTTP::uri]] {
"/mytestsite1" {
HTTP::redirect "https://mywebsite.test.edu/mytestsite1/Authentication/Login?"
}
"/mytestsite1/*" {
if {[HTTP::host] ne ""} {
HTTP::header replace Host "differentname.test.edu"
HTTP::uri [string map -nocase {"/mytestsite1/" "/differentname1/"} [HTTP::uri]]
}
pool mypool1
return
}
"/mytestsite2" {
HTTP::redirect "https://mywebsite.test.edu/mytestsite2/Authentication/Login?"
}
"/mytestsite2/*" {
if {[HTTP::host] ne ""} {
HTTP::header replace Host "differentname.test.edu"
HTTP::uri [string map -nocase {"/mytestsite2/" "/differentname2/"} [HTTP::uri]]
}
pool mypool2
return
}
"/mytestsite3" {
HTTP::redirect "https://mywebsite.test.edu/mytestsite3/Authentication/Login?"
}
"/mytestsite3/*" {
if {[HTTP::host] ne ""} {
HTTP::header replace Host "differentname.test.edu"
HTTP::uri [string map -nocase {"/mytestsite3/" "/differentname3/"} [HTTP::uri]]
}
pool mypool3
return
}
}
}
}
}
This just looks like formatting of the code layout. Went ahead and tried it but no difference.
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
