Forum Discussion
mb_shankr_22532
Oct 04, 2015Nimbostratus
need help to create an irule to append an uri and redirect with conditions...
Hi all, need ur help pls. I have an URL: abc.test.com, pointing to http vip with mapped pool-1111. I also have another pool-2222 created with same members but different ports. pool-2222 is not mapped...
Stanislas_Piro2
Oct 05, 2015Cumulonimbus
Hi,
If you want to allow /test1, you can redirect / to /test1/ instead of rewriting path.
- if you rewrite path and the content of the response contains links like img/logo.php, the browser will request /img/logo.php.
- if you redirect to /test1/ and the content of the response contains links like img/logo.php, the browser will request /test1/img/logo.php
You can also store the virtual server default pool in a variable to use it in the "default" statement.
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
switch [string tolower [HTTP::path]] {
"/" {
HTTP::redirect /
}
"/test1" -
"/test1/" {
pool pool-1111
}
"/test2" -
"/test2/" {
pool pool-2222
} default {
pool $default_pool
}
}
}
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