UniFirst1_22521
Jan 14, 2019Nimbostratus
Using an iRule to redirect with a 301 response code
Trying to redirect using a iRule first removing any www from the header and sending back a 301 response. I have the following iRule for removing the www from the header. However, not sure how to do the 301 response. Would like to do both in same irule. The default 302 is not acceptable.
when HTTP_REQUEST { if { [string tolower [HTTP::host]] starts_with "; } { HTTP::redirect "https://[findstr [string tolower [HTTP::host]] "; 4][HTTP::uri]" } }
Any ideas? Thanks