Forum Discussion
cymru81
Sep 17, 2021Altocumulus
https non www redirect
Hi, im trying to use an irule to direct traffic from https://example.com to https://www.example.com, im using the following but it just wont work! Any suggestions appreciated! when HTTP_REQUES...
Sep 17, 2021
Hi cymru81,
This iRule should work. Is there any other irule attached in virtual server?
After adding the log lines, can you investigate the ltm logs?
when HTTP_REQUEST {
log local0. "wwwredirect1 | Host: [HTTP::host]"
if { [HTTP::host] equals "example.com" } {
log local0. "wwwredirect2 | Host: [HTTP::host]"
HTTP::respond 301 Location "https://www.[HTTP::host][HTTP::uri]"
return
}
}
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