Forum Discussion
1000blocks
Nimbostratus
Jul 07, 2016301 iRule redirection generating an extra 301 status code?!?
Hi,
We have this iRule in place for 301 redirection...
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] eq "sitename.com" } then {
HTTP::respond 301 Location ...
Yann_Desmarest
Cirrus
Jul 07, 2016Hi,
May I suggest to use the irule below instead :
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] eq "sitename.com" } {
HTTP::respond 301 Location "https://www.sitename.com[HTTP::uri]" Test TestRedirect Connection Close
}
}
I think that the irule originally posted may generate a loop on the client side. moreover, you should see TCL errors on ltm log files as then keyword is not supported (AFAIK)
Do you have a backend that is listening on http ? Can you check that this is really the F5 that generate the redirect not the backend ?
In my example, a redirect caused by F5 should generate a specific header named Test to be sent with the redirect response.
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