Forum Discussion
Albert__Tase_70
Nimbostratus
Jan 03, 2007ok here it is again now all but the last part is excepted
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set ua [string tolower [HTTP::header "User-Agent"]]
set uri [HTTP::uri]
if { ($host contains "demo.nature.com") ||
($host contains "deutsche.nature.com") ||
($host contains "mailart.nature.com") ||
($host contains "fastart.nature.com") } {
pool nature
} elseif { ($ua contains "google") || ($ua contains "ask") || ($ua contains "msn") } {
pool spider_pool
} elseif { $host contains "isn-online.org" } {
if { ($uri equals "/") || ($uri equals "/index.html") } {
HTTP::redirect "http://www.nature.com/isn"
} else {
pool Java
}
} elseif { ($uri starts_with "/registration/Modify_registration.taf") || ($uri starts_with "/registration/modify_registration.taf") || ($uri starts_with "/registration/index.taf") } {
HTTP::redirect "http://www.palgrave-journals.com/myaccount"
} elseif { ($uri starts_with "/registration/register.taf") || ($uri equals "/pal/register/redirect.taf") } {
HTTP::redirect "http://www.palgrave-journals.com/register"
} elseif { ( $uri starts_with "/site_registration/site_login.taf") } {
HTTP::redirect "http://www.palgrave-journals.com/nams/svc/mysiteaccount"
} elseif { $uri equals "/site_registration/"} {
HTTP::redirect "http://www.nature.com/mysiteaccount"
} elseif { ($uri starts_with "/site_registration/site_register.taf") } {
HTTP::redirect "http://www.nature.com/siteregister"
} elseif { ($uri starts_with "/offer/") || ($uri starts_with "/cgi-taf/links.taf") } {
HTTP::redirect "http://www.nature.com/empty.txt"
} elseif { ($uri starts_with "/cgi-taf/button_link.taf") } {
HTTP::redirect "http://www.nature.com/index.html"
} elseif { ($uri starts_with "/cgi-taf/subscribe_link.taf") } {
HTTP::redirect "https://secure.nature.com/subscribe/nature"
} elseif { ($uri starts_with "/dynasearch") || ($uri starts_with "/Dynasearch") || ($uri starts_with "/DynaSearch") } {
HTTP::redirect "http://www.nature.com/common/access/replaced.vm"
} elseif { ($uri starts_with "/cgi-taf/Ea2.taf") } {
HTTP::redirect "http://www.nature.com/nature-events/search-events/index.html"
} elseif { ($uri starts_with "/login/password_help.taf") } {
HTTP::redirect "http://www.nature.com/nams/svc/lostpassword"
} elseif { ($uri starts_with "/help/advertising") } {
HTTP::redirect "http://npg.nature.com/media/nature/index.html"
} elseif { $host contains "www.emboj.org"} {
HTTP::redirect "http://www.nature.com/emboj/"
} elseif { $host contains "emboreports.npgjournals.com"} {
HTTP::redirect "http://www.nature.com/embor/"
} elseif { $host contains "embojournals.npgjournals.com"} {
HTTP::redirect "http://www.nature.com/emboj/"
} elseif { $host contains "www.npgjournals.com"} {
HTTP::redirect "http://www.nature.com/embojournal/"
} elseif { $host contains "www.journalofmedicalmarketing.com"} {
HTTP::redirect "http://www.palgrave-journals.com/jmm"
} elseif { $host contains "www.damjournal.com"} {
HTTP::redirect "http://www.palgrave-journals.com/dam"
} elseif { ($uri starts_with "/press/") } {
HTTP::redirect "http://press.nature.com"
} elseif { ($uri starts_with "/public/") } {
HTTP::redirect "http://nurture.nature.com/search"
} elseif { [HTTP::host] equals "www.nature.com" && [HTTP::uri] starts_with "/rss/" && [HTTP::uri] ends_with "/index.html" }
{HTTP::redirect "http://www.nature.com/webfeeds/index.html" } }}}
on the above rule I ghet the following error:
01070151:3: Rule [chris_test] error:
line 59: [parse error: extra characters after close-brace] [}
}]
line 60: [command is not valid in the current scope] [}]
please help me resolve this thanks
Al Tase
- hoolio
Cirrostratus
I cleaned up an earlier version of the rule you posted in this thread: - Albert__Tase_70
Nimbostratus
the above rule works except for the last part the rule you posted gives me syntx errors if I remove the following the rule works: - Deb_Allen_18Historic F5 AccountHi Al --
} elseif { [HTTP::host] equals "www.nature.com" && [HTTP::uri] starts_with "/rss/" && [HTTP::uri] ends_with "/index.html" }{ HTTP::redirect "http://www.nature.com/webfeeds/index.html" first closing curly brace terminates "if" statement } second one terminates HTTP_REQUEST event } third one terminates iRule }
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