Forum Discussion
johtte_168100
Nimbostratus
Oct 28, 2015redirect to new path
Hi, i have this url https://abc.com/site1/online/index.html and want to redirect to this site https://abc.com/online/index.html but it doesn't work.
I try to this irule:
when HTTP_REQUEST {...
IheartF5_45022
Nacreous
Oct 29, 2015I think maybe you actually want to transparently rewrite and select pool based on incoming request rather than actually redirect (which sends a response to the client instructing it to re-request a new URL). Does this look like what you want (this assumes pl_pool has member 1.1.1.1:80 and pl_pool2 has member 2.2.2.2:80)?;-
HTTP_REQUEST {
Check the requested path
switch -glob [HTTP::path] {
"/site1/online/index.html"{
HTTP::path "/online"
pool pl_pool1
}
"/site1/online/authenticate.html"{
HTTP::path "/online"
pool pl_pool2
}
}
}
Alternatively if you really do want to redirect this would be an option;
when HTTP_REQUEST {
Check the requested path with wildcard matching
switch -glob [HTTP::uri] {
"/site1/online*" {
HTTP::respond 302 noserver Location "/online?default"
return
}
"/site1/online/authenticate.html"
{
HTTP::respond 302 noserver Location "/online?authenticate"
return
}
"/online?default"{
HTTP::uri [HTTP::path]
pl_pool1
}
"/online?authenticate"{
HTTP::uri [HTTP::path]
pl_pool2
}
}
}
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