Forum Discussion
https to https redirection
is it possible to redirect a https url ? for example, when https://page1.com arrives can an irule redirect to https://page2.com
Redirection can be achieve by either F5 policy(V11.3 onward) or iRule.
- Policy is the best option to achieve this kind of redirection, same already discussed by @WithF5. In-fact F5 policy is good to explore in new era.
Option 2. Same can be achieve via iRule. iRule is already shared by devcentral Colleague. Did some modification in above iRule. Hope it will work for you.
when HTTP_REQUEST { if { ([string tolower [HTTP::host]] equals "page1.com") && ([TCP::local_port] == 443)} { HTTP::redirect "http://page2.com" } }
- Gonzalex_330537Cirrostratus
Create an iRule and attach it to your virtual server. The iRule should be along these lines:
when HTTP_REQUEST { if { [HTTP::host] equals "page1.com"} { HTTP::redirect "; } }
Check for more examples here: https://devcentral.f5.com/wiki/iRules.HTTP__host.ashx
- WithF5Nimbostratus
Do not do use iRules to do that... use policies ! Check this link: https://devcentral.f5.com/s/feed/0D51T00006i7WvASAU
 
The steps might be a little bit different from the version that you are using.
 
- RaghavendraSYAltostratus
Please try below irule
when HTTP_REQUEST { if { [HTTP::host] equals "; } { HTTP::redirect "; } }
Make sure http profile is enabled for virtual server if not you will not be able to assign irule
- Samir_Jha_52506Noctilucent
Redirection can be achieve by either F5 policy(V11.3 onward) or iRule.
- Policy is the best option to achieve this kind of redirection, same already discussed by @WithF5. In-fact F5 policy is good to explore in new era.
Option 2. Same can be achieve via iRule. iRule is already shared by devcentral Colleague. Did some modification in above iRule. Hope it will work for you.
when HTTP_REQUEST { if { ([string tolower [HTTP::host]] equals "page1.com") && ([TCP::local_port] == 443)} { HTTP::redirect "http://page2.com" } }
- Patrick_Sevill1Nimbostratus
Thank you f5_rock, This works ! Great idea checking port, when 443 then apply redirect.
- RyannnnnnnnnAltocumulus
Bearing in mind that all the responses so far are relying on the fact that you've configured your https virtual server with the appropriate profiles (e.g. client ssl, http)
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