Forum Discussion
redirect non www to https+www
Hello to all, Im trying to get ahold of irule to redirect any traffic coming to my website example.com to https://www.example.com[uri]
I've been searching over google for couple of hours now.
Thanks in advance
- habib_KhanNimbostratus
Hi Chenco,
You can try this below redirection irule.
when HTTP_REQUEST { if {[string tolower [HTTP::host]] eq "example.com"} HTTP::respond 301 Location "https://www.[HTTP::host][HTTP::uri]" } Let me know if any issue. Thanks & Regards, Habib Khan
- RaghavendraSYAltostratus
Hi,
You can default system irule for http to https redirection. Irule name is _sys_https_redirect. when HTTP_REQUEST { HTTP::redirect https://[getfield [HTTP::host] ":" 1][HTTP::uri] }
or you can use custom irule as mentioned below. when HTTP_REQUEST {
if {[HTTP::host] equals "test.com"} {HTTP::respond 301 "Location" "https://test.com[HTTP::uri]"} }
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