Forum Discussion

Albert__Tase_70's avatar
Albert__Tase_70
Icon for Nimbostratus rankNimbostratus
Jan 02, 2007

I ruke conversion need help bad

ok there has been a thread on this irule I fixed syntax error now getting aline 5 command error please help |||| th irule is below:

 

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 { $host contains "www.palgrave-journals.com" } {

 

if { ($uri equals "/") || ($uri equals "/index.html" ) } {

 

HTTP::redirect "http://www.palgrave-journals.com/pal"}

 

} elseif { $uri equals "/mysiteaccount" } {

 

HTTP::redirect "http://www.palgrave-journals.com/nams/svc/mysiteaccount"

 

} elseif { ($uri starts_with "/cgi-bin") || ($uri starts_with "/services/link.taf") || ($uri equals "/login/login.taf") } {

 

use pool nature

 

} 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"

 

 

also get errors when I try to add the last piece you helped me with which is

 

} 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"}

 

 

}

 

 

thanks I( need the above i rule to work it is complicated and need it done because i need to migrate to the new f5 soon very soon and cannot due this until all the irules have been converted we also purchased the install help with the normal service contract.

 

 

Thanks

 

 

Al Tase

 

No RepliesBe the first to reply