Forum Discussion
f5_user_7996
Aug 08, 2012Nimbostratus
redirection loop
Hi all,
Anybody could help me on this scenario
A customer wants to redirect their website with 301 response with the following scenarios.
1) customer.co.nz -> http://www.customer.co.nz/Pages/default.aspx
2) www.customer.co.nz -> http://www.customer.co.nz/Pages/default.aspx
I was able to sort the first one with this irule:
when HTTP_REQUEST {
if { [string tolower [HTTP::]] equals "customer.co.nz" } {
HTTP::respond 301 location http://www.customer.co.nz/Pages/Default.aspx
}
}
But on the second one when I apply the rule below it says on my browser "redirection loop"
when HTTP_REQUEST {
if { [string tolower [HTTP::]] equals "www.customer.co.nz" } {
HTTP::respond 301 location http://www.customer.co.nz/Pages/default.aspx"
}
}
I'm not sure what's wrong with the second rule, they are separate irule and both mounted on one virtual server.
Thanks.
6 Replies
Sort By
- Hi,
- Hi Abdul,
- Hi F5_user,
Hi Abdul,
I tried same, but still getting into redirect loop. when HTTP_REQUEST { if {([string tolower [HTTP::host]] contains "www.test.com") and ([HTTP::path] equals "/")} { HTTP::respond 301 location "http://www.test.com/en-us" } }
Hi avi123,
in
path ishttp://www.test.com/en-us
/
is a fragment identifier and is not part of pathen-us
are you sure the fragment is sent to the F5? look this thread for more info.
Hi Stanislas,
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