Forum Discussion
Ravi_110217
Nimbostratus
Mar 11, 2008HTTP page redirection request
Hello Guys,
I wonder if someone could help me with following web page redirection rule. I am not much more familiar with F5 product, please help me out with my following request.
I want to redirect one of our web page... example,
www.abc.com.au to
www.abc.com.au/abconline/HomePage.aspx
I have written following irule but does not seem to be working for me.
when HTTP_REQUEST {
if { [HTTP::host] equals "www.abc.com.au" }
{
HTTP::redirect "http://www.abc.com.au/abconline/HomePage.aspx"}
}
I'm using following IOS on my F5:
BIG-IP 9.3.0 Build 187.3...
Hope to hear soon.
Ta,
4 Replies
Sort By
- The problem with your iRule is that it will lead to an infinite loop. The redirect will go back into the iRule and, since the host is the same, it will issue the redirect again. You'll want to add a check to see if the URI is blank before issuing the redirect. I'm also not sure what's up with the close curly brace after your HTTP redirect statement. That should go too...
when HTTP_REQUEST { if { ([HTTP::host] eq "www.abc.com.au") && ([HTTP::uri] eq "/") } { HTTP::redirect "http://www.abc.com.au/abconline/HomePage.aspx" } }
- The_Bhattman
Nimbostratus
Joe,([HTTP::host] eq "www.abc.com.au") && ([HTTP::uri] eq "/")
- I don't know for a fact since I haven't tested it, but any language worth anything would not evaluate and expressions if they have no consequence. If you are really worried about it, you could always use nested ifs.
- The_Bhattman
Nimbostratus
The idea I was toying around with is basically trying to increase the performance to evaluation. I know that Perl does this, but wasn't sure if iRULE did the same.
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