Forum Discussion
UniFirst1_22521
Nimbostratus
Jan 14, 2019Using 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 t...
Rico
Cirrus
Jan 14, 2019I believe this iRule should work for you.
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] starts_with "www." }
{
HTTP::respond 301 "Location" "https://[findstr [string tolower [HTTP::host]] "www." 4][HTTP::uri]"
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
