Forum Discussion
irules
Could you please advise if this syntax for irules is correct? This is for a page redirect.
when HTTP_RESPONSE { if { [HTTP::status] contains "404" or [HTTP::status] contains "410" or [HTTP::status] contains "500" or [HTTP::status] contains "503"} { HTTP::redirect "; } }
5 Replies
- eben
Nimbostratus
It could be, but you are better of using a DataGroup List. You can create a type String.
when HTTP_RESPONSE { if {[class match [HTTP::status] contains} HTH eben.- cjunior
Nacreous
eben,
This way it will work, but is not it bad to implement to this simple verification?
Respectfully,
- eben_259100
Cirrostratus
It could be, but you are better of using a DataGroup List. You can create a type String.
when HTTP_RESPONSE { if {[class match [HTTP::status] contains} HTH eben.- cjunior
Nacreous
eben,
This way it will work, but is not it bad to implement to this simple verification?
Respectfully,
- cjunior
Nacreous
Hello uhuru187,
I'd prefer to do this:when HTTP_RESPONSE { if { [HTTP::status] == 404 || [HTTP::status] == 410 || [HTTP::status] == 500 || [HTTP::status] == 503 } { HTTP::redirect "https://thiswebsite.com"; } }Since "[HTTP::status]" returns a HTTP code and check with "equals" operator.
Regards.
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
