Forum Discussion
http to https based on url
Hi, wondering if someone can help, we have two http sites running on a single VIP eg livesite.domain.com and testsite.domain.com is it possible to redirect them to the https equivalent with an irule?
For single sites we have applied below and this works fine:
when HTTP_REQUEST {
TCP::respond "HTTP/1.1 302 Found\r\nLocation: https://examplesite.domain.com\r\nConnection: close\r\nContent-Length: 0\r\n\r\n"
TCP::close
}
Hello,
You can create one VIP using same IP address as that of existing https VIP and keep it listening on http (80) port. And bind F5 provided redirect iRule to it - 'sys_https_redirect'
This VIP will redirect all request to https.
Hope it helps!
Mayur
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