Forum Discussion
Colin_17201
Nimbostratus
Jun 15, 2008Help On Redirect on F5
Hi All,
I got a problem is when i enable the "rewrite redirect" on the http profile. After i turn it on with the "matching" not even putting any irules in the Virtual Server, when i type in any url on the web browswer it will automatically turn me to the https page.
For example : i type http://www.abc.com then it turn me to https://www.abc.com
I would like to know is this normal ??
Please HELP.......
5 Replies
- hoolio
Cirrostratus
The rewrite redirect option is triggered without respect to an iRule. This is expected behavior.
What are you trying to accomplish with an iRule and/or the rewrite redirects option?
Aaron - Colin_17201
Nimbostratus
I would like to redirect when access to http://abc.com then redirect it to http://abc.com/abc with the irule below but it keeps on looping. Headache... I am new to iRule.
when HTTP_REQUEST {
if { [HTTP::host] equals "abc.com"}{
HTTP::redirect http://abc.com/abc}
else return
} - hoolio
Cirrostratus
I assume you only want to redirect requests for abc.com to the root document to /abc. If so, you can add a check for the path:when HTTP_REQUEST { if {[string tolower [HTTP::host]] equals "abc.com" && [HTTP::path] eq "/"}{ HTTP::redirect "http://abc.com/abc" } }
Aaron - Colin_Walker_12Historic F5 AccountThe reason you were getting a loop is because you were forwarding everything that has a host of abc.com to abc.com/abc.
This means abc.com/bob, abc.com/fred, and even abc.com/abc all get redirected to abc.com/abc. That last instance is the loop case.
Hoolio's got you covered with his modified rule above.
Colin - Hamish
Cirrocumulus
Not necessarily.
RTFM... The [HTTP::uri] basically returns everything after the host in the URL. [HTTP::path] does the same, EXCEPT that path doesn't include any variables (i.e. everything after the ? is dropped).
If there are no variables/parameters specified, then they will be equivalent, otherwise not.
H
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
