Forum Discussion
Albert__Tase_70
Nimbostratus
Feb 01, 2006Irule for 4.6.1
Hello below is an Irule for redirect could I plase get some recomendations the tac suggested that i post this rule here thank you
if (http_host contains "demo.nature.com" or http_host contains "deutsche.nature.com" or http_host contains "mailart.nature.com" or http_host contains "fastart.nature.com" or http_host contains "naturereprints.com") {
use pool nature
}
else if (http_host contains "isn-online.org") {
if (http_uri == "/" or http_uri == "/index.html") {
redirect to "http://www.isn-online.org/isn"
}
else {
use pool Java
}
}
else if (http_host contains "www.palgrave-journals.com") {
if (http_uri == "/" or http_uri == "/index.html") {
redirect to "http://www.palgrave-journals.com/pal"
}
else if (http_uri == "/mysiteaccount") {
redirect to "http://www.palgrave-journals.com/nams/svc/mysiteaccount"
}
else if (http_uri starts_with "/cgi-bin" or http_uri == "/rss" or http_uri starts_with "/services/link.taf" or http_uri starts_with "/doifinder/10.1057" or http_uri starts_with "/doifinder/10.1080" or http_uri == "/login/login.taf") {
use pool nature
}
else if (http_uri starts_with "/registration/Modify_registration.taf" or http_uri starts_with "/registration/modify_registration.taf" or http_uri starts_with "/registration/index.taf") {
redirect to "http://www.palgrave-journals.com/myaccount"
}
else if (http_uri starts_with "/registration/register.taf" or http_uri == "/pal/register/redirect.taf") {
redirect to "http://www.palgrave-journals.com/register"
}
else if (http_uri starts_with "/site_registration/site_login.taf") {
redirect to "http://www.palgrave-journals.com/nams/svc/mysiteaccount"
}
else if (http_uri == "/site_registration/") {
redirect to "http://www.palgrave-journals.com/nams/svc/mysiteaccount"
}
else if (http_uri starts_with "/site_registration/site_register.taf") {
redirect to "http://www.palgrave-journals.com/nams/svc/siteregister"
}
else if (http_uri starts_with "/offer/" or http_uri starts_with "/cgi-taf/links.taf") {
redirect to "http://www.palgrave-journals.com/empty.txt"
}
else if (http_uri starts_with "/cgi-taf/button_link.taf") {
redirect to "http://www.palgrave-journals.com/"
}
else if (http_uri starts_with "/cgi-taf/subscribe_link.taf") {
redirect to "http://www.palgrave-journals.com/subscribe"
}
else if (http_uri starts_with "/dynasearch" or http_uri starts_with "/Dynasearch" or http_uri starts_with "/DynaSearch") {
redirect to "http://www.palgrave-journals.com/common/access/replaced.vm"
}
else {
use pool palgrave-foxtrot
}
}
else if (http_uri starts_with "/reports" or http_uri starts_with "/cgi-bin" or http_uri == "/rss" or http_uri starts_with "/services/link.taf" or http_uri starts_with "/ebd/cpd/" or http_uri starts_with "/doifinder/10.1057" or http_uri starts_with "/doifinder/10.1080" or http_uri == "/login/login.taf") {
use pool nature
}
else if (http_uri starts_with "/registration/Modify_registration.taf" or http_uri starts_with "/registration/modify_registration.taf" or http_uri starts_with "/registration/index.taf") {
redirect to "http://www.nature.com/myaccount"
}
else if (http_uri starts_with "/registration/register.taf") {
redirect to "http://www.nature.com/register"
}
else if (http_uri starts_with "/site_registration/site_login.taf") {
redirect to "http://www.nature.com/mysiteaccount"
}
else if (http_uri == "/site_registration") {
redirect to "http://www.nature.com/mysiteaccount"
}
else if (http_uri starts_with "/site_registration/site_register.taf") {
redirect to "http://www.nature.com/siteregister"
}
else if (http_uri starts_with "/offer/" or http_uri starts_with "/cgi-taf/links.taf") {
redirect to "http://www.nature.com/empty.txt"
}
else if (http_uri starts_with "/cgi-taf/button_link.taf") {
redirect to "http://www.nature.com/index.html"
}
else if (http_uri starts_with "/cgi-taf/subscribe_link.taf") {
redirect to "https://secure.nature.com/subscribe/nature"
}
else if (http_uri starts_with "/dynasearch" or http_uri starts_with "/Dynasearch" or http_uri starts_with "/DynaSearch") {
redirect to "http://www.nature.com/common/access/replaced.vm"
}
else if (http_uri starts_with "/cgi-taf/Ea2.taf") {
redirect to "http://www.nature.com/nature-events/search-events/index.html"
}
else if (http_uri starts_with "/login/password_help.taf") {
redirect to "http://www.nature.com/nams/svc/lostpassword"
}
else if (http_uri starts_with "/help/advertising") {
redirect to "http://npg.nature.com/media/nature/index.html"
}
else if (http_host contains "www.emboj.org") {
redirect to "http://www.nature.com/emboj/"
}
else if (http_host contains "emboreports.npgjournals.com") {
redirect to "http://www.nature.com/embor/"
}
else if (http_host contains "embojournals.npgjournals.com") {
redirect to "http://www.nature.com/emboj/"
}
else if (http_host contains "www.npgjournals.com") {
redirect to "http://www.nature.com/embojournal/"
}
else if (http_host contains "www.natureprotocols.com") {
redirect to "http://www.nature.com/nprot/index.html"
}
else if (http_host contains "www.journalofmedicalmarketing.com") {
redirect to "http://www.palgrave-journals.com/jmm"
}
else if (http_host contains "www.damjournal.com") {
redirect to "http://www.palgrave-journals.com/dam"
}
else if (http_uri == "/nmeth/applicationnotes") {
redirect to "http://www.nature.com/app_notes/nmeth"
}
else if (http_uri == "/nmeth/applicationnotes/") {
redirect to "http://www.nature.com/app_notes/nmeth"
}
else if (http_uri starts_with "/press/") {
redirect to "http://press.nature.com"
}
else {
use pool Java
}
- Colin_Walker_12Historic F5 AccountThat's quite the rule...
- Albert__Tase_70
Nimbostratus
would like to know if anyone has any ideas on how to optimize the Irule its kinda been identified with site latenacy and outages do to high traffic load and th ddeamon parsing this rule for the traffic - Martin_MachacekHistoric F5 AccountFirst of all, there is no "daemon" parsing iRules in v4.x. Complex rules (like yours) may really cause high latency.
rule host_switch { if(http_host == "www.palgrave-journals.com") { redirect to "http://www.palgrave-journals.com:81" + http_uri } else if(http_host == "www.nature.com") { redirect to "http://www.nature.com:82" + http_uri } else if( .... } rule palgrave { } rule nature { } ... virtual :80 { use rule host_switch } virtual :81 { use rule palgrave } virtual :82 { use rule nature } ...
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