Forum Discussion
1000blocks
Nimbostratus
Mar 02, 2016HTTP to HTTPS 301 redirection
Hi, I have just written an iRule for the following purposes: http://sitename.com (without the WWW) should 301 redirect to https://www.sitename.com http://www.sitename.com should 301 redirec...
Kai_Wilke
MVP
Mar 02, 2016Hi 1000blocks,
the iRule below should catch them all...
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] eq "sitename.com" } then {
HTTP::respond 301 Location "https://www.sitename.com[HTTP::uri]"
} else {
HTTP::respond 301 Location "https://[getfield [HTTP::host] ":" 1][HTTP::uri]"
}
}
Cheers, Kai
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
