Forum Discussion
irule not working
I have the following irule and i get syntax errors I dont know what i am missing Basically if someone type www.mathzone.com/blah or anything after www.mathzone.com/ i want to redirect to successinhighered.com/math/
what am i doing wrong?
when HTTP_REQUEST {
if {([string tolower[HTTP::host]] equals "www.mathzone.com") and ([string tolower[HTTP::uri]] starts_with "/*") }{
{
HTTP::redirect http://successinhighered.com/math/
}
}
2 Replies
- Kevin_Stewart
Employee
Try this:
when HTTP_REQUEST { if { ( [string tolower [HTTP::host]] equals "www.mathzone.com" ) and ( [HTTP::uri] ne "/" ) } { HTTP::redirect "http://successinhighered.com/math/" } }If I understood you correctly, if the user adds ANY URI at all, you want to redirect them. So
http://www.mathzone.com does not redirect http://www.mathzone.com/blah does redirectIs that correct?
- Kirit_Patel_521
Nimbostratus
so basically if a user types http://www.mathzone.com and anything after the url like www.mathzone.com/joe . so anything after www.mathzone.com/xxx should redirect to
http://successinhighered.com/math/"
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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