Forum Discussion
El-Guapo_29797
Nimbostratus
Sep 03, 2013*Redirect http to https & add www to URL if none present*
Like to Redirect all http to https and add www to URL if not present already.
2 Replies
- Kevin_Stewart
Employee
Try this:
when HTTP_REQUEST { if { not ( [string tolower [HTTP::host]] starts_with "www." ) } { HTTP::redirect "https://www.[HTTP::host][HTTP::uri]" } else { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } } - El-Guapo_29797
Nimbostratus
This works. Thank you.
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