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, 2015If you want to issue a clientside redirect try this (I use HTTP::respond as I like to use 301, and also like to use 'noserver' to hid the Server:BigIP header).
HTTP_REQUEST {
Check the requested path with wildcard matching
switch -glob [HTTP::path] {
"site1/online/index.html"{
301 Redirect
HTTP::respond 301 noserver Location "/online"
return
}
"online/"{
pool 1.1.1.1
}
}
}
johtte_168100
Nimbostratus
Oct 29, 2015Hi, thanks for this another idea. but if we check later the same url but redirect to another pool for example
First request -> site1/online/index.html, after that change the path to /online/ redirect to pool 1.1.1.1
Second request -> site1/online/authenticate.html ->change the path to /online redirect to pool 2.2.2.2
when HTTP_REQUEST {
Check the requested path with wildcard matching
switch -glob [HTTP::path] {
"/site1/online"
{
HTTP::respond 302 noserver Location "/online"
return
}
"/online" {
pool 1.1.1.1
}
}
switch -glob [HTTP::uri] {
"/site1/online/authenticate.html"
{
HTTP::respond 302 noserver Location "/online"
return
}
"/online"{
pool 2.2.2.2
}
}
}
Something like this?
Thanks for your help
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